From 49be87fe371d1f8a5895f42513a943b5bf2a5a7c Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Tue, 15 Dec 2020 12:06:24 +0100 Subject: [PATCH] code style --- src/documents/models.py | 6 +++++- src/documents/serialisers.py | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/documents/models.py b/src/documents/models.py index 1b1f697bc..b544f413d 100755 --- a/src/documents/models.py +++ b/src/documents/models.py @@ -340,7 +340,11 @@ class SavedViewFilterRule(models.Model): (17, "Does not have tag"), ] - saved_view = models.ForeignKey(SavedView, on_delete=models.CASCADE, related_name="filter_rules") + saved_view = models.ForeignKey( + SavedView, + on_delete=models.CASCADE, + related_name="filter_rules" + ) rule_type = models.PositiveIntegerField(choices=RULE_TYPES) diff --git a/src/documents/serialisers.py b/src/documents/serialisers.py index 2def07fdd..36878448c 100644 --- a/src/documents/serialisers.py +++ b/src/documents/serialisers.py @@ -167,14 +167,16 @@ class SavedViewSerializer(serializers.ModelSerializer): if rules_data: SavedViewFilterRule.objects.filter(saved_view=instance).delete() for rule_data in rules_data: - SavedViewFilterRule.objects.create(saved_view=instance, **rule_data) + SavedViewFilterRule.objects.create( + saved_view=instance, **rule_data) return instance def create(self, validated_data): rules_data = validated_data.pop('filter_rules') saved_view = SavedView.objects.create(**validated_data) for rule_data in rules_data: - SavedViewFilterRule.objects.create(saved_view=saved_view, **rule_data) + SavedViewFilterRule.objects.create( + saved_view=saved_view, **rule_data) return saved_view