From 5470fbdb7c301307cbaa77fb2dbd730a64acf245 Mon Sep 17 00:00:00 2001 From: Guillaume Englert Date: Fri, 4 Aug 2023 15:51:38 +0200 Subject: [PATCH] Fix some issues raised by flake8. --- creme/billing/models/line.py | 2 +- creme/vcfs/vcf_lib/base.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/creme/billing/models/line.py b/creme/billing/models/line.py index dd8c0546b9..200ceef955 100644 --- a/creme/billing/models/line.py +++ b/creme/billing/models/line.py @@ -241,7 +241,7 @@ def related_item_class(): def save(self, *args, **kwargs): if not self.pk: # Creation assert self._related_document, 'Line.related_document is required' - assert bool(self._related_item) ^ bool(self.on_the_fly_item),\ + assert bool(self._related_item) ^ bool(self.on_the_fly_item), \ 'Line.related_item or Line.on_the_fly_item is required' self.user = self._related_document.user diff --git a/creme/vcfs/vcf_lib/base.py b/creme/vcfs/vcf_lib/base.py index ff396b37f3..6f7d132206 100644 --- a/creme/vcfs/vcf_lib/base.py +++ b/creme/vcfs/vcf_lib/base.py @@ -281,12 +281,14 @@ def __setattr__(self, name, value): which are legal in IANA tokens. """ if name.endswith('_param'): - if type(value) == list: + # if type(value) == list: + if isinstance(value, list): self.params[toVName(name, 6, True)] = value else: self.params[toVName(name, 6, True)] = [value] elif name.endswith('_paramlist'): - if type(value) == list: + # if type(value) == list: + if isinstance(value, list): self.params[toVName(name, 10, True)] = value else: raise VObjectError("Parameter list set to a non-list")