From 0b8c3c9cbb7e78ebb1b5d84f79ff682734790286 Mon Sep 17 00:00:00 2001 From: Bob Booij-Liewes Date: Sun, 12 Jan 2025 21:52:26 +0100 Subject: [PATCH] Fix linting --- binder/models.py | 2 +- binder/views.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/binder/models.py b/binder/models.py index c45e41ae..de1cd5af 100644 --- a/binder/models.py +++ b/binder/models.py @@ -943,7 +943,7 @@ def update_dimension_fields(self, instance, force=False, *args, **kwargs): if not file and not force: return - dimension_fields_filled = not( + dimension_fields_filled = not ( (self.width_field and not getattr(instance, self.width_field)) or (self.height_field and not getattr(instance, self.height_field)) ) diff --git a/binder/views.py b/binder/views.py index 4cd681fb..9ec9f8df 100644 --- a/binder/views.py +++ b/binder/views.py @@ -616,7 +616,7 @@ def _annotate_objs(self, datas_by_id, objs_by_id): for obj_id, data in datas_by_id.items(): # TODO: Don't require OneToOneFields in the m2m_fields list if isinstance(local_field, models.OneToOneRel): - assert(len(idmap[obj_id]) <= 1) + assert (len(idmap[obj_id]) <= 1) data[field_name] = idmap[obj_id][0] if len(idmap[obj_id]) == 1 else None else: data[field_name] = idmap[obj_id] @@ -1476,7 +1476,7 @@ def store_m2m_field(obj, field, value, request): try: obj.save() - assert(obj.pk is not None) # At this point, the object must have been created. + assert (obj.pk is not None) # At this point, the object must have been created. except ValidationError as ve: validation_errors.append(self.binder_validation_error(obj, ve, pk=pk))