From ed4640e7c1e1001dcc02fa90d3bef3eab9a59f84 Mon Sep 17 00:00:00 2001 From: Tore Brede <Tore.Brede@uib.no> Date: Fri, 20 Aug 2021 10:43:32 +0200 Subject: [PATCH] Fixing formatting --- greg/api/serializers/person.py | 7 +++++-- greg/api/views/person.py | 4 +--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/greg/api/serializers/person.py b/greg/api/serializers/person.py index c48a69d2..43e3dbcf 100644 --- a/greg/api/serializers/person.py +++ b/greg/api/serializers/person.py @@ -47,5 +47,8 @@ class PersonIdentitySerializer(serializers.ModelSerializer): return False # If the type is a specific ID type, then duplicates are not expected - return PersonIdentity.objects.filter(type__like=identity_type).filter( - value__like=value).exists() + return ( + PersonIdentity.objects.filter(type__like=identity_type) + .filter(value__like=value) + .exists() + ) diff --git a/greg/api/views/person.py b/greg/api/views/person.py index 32c33ef7..40f9c8d0 100644 --- a/greg/api/views/person.py +++ b/greg/api/views/person.py @@ -105,9 +105,7 @@ class PersonIdentityViewSet(viewsets.ModelViewSet): serializer = self.get_serializer(data=input_data) - if serializer.is_duplicate( - input_data["type"], input_data["value"] - ): + if serializer.is_duplicate(input_data["type"], input_data["value"]): raise ValidationError("Duplicate identity entry exists") serializer.is_valid(raise_exception=True) -- GitLab