Skip to content

Commit

Permalink
Fix some issues raised by flake8.
Browse files Browse the repository at this point in the history
  • Loading branch information
genglert committed Aug 4, 2023
1 parent e2d8b9a commit 5470fbd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion creme/billing/models/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions creme/vcfs/vcf_lib/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 5470fbd

Please sign in to comment.