Skip to content
Snippets Groups Projects
Commit 3ffa28da authored by Tore.Brede's avatar Tore.Brede
Browse files

Updating to use exists-method to check for duplicates

parent a7f58875
No related branches found
No related tags found
1 merge request!21GREG-17: Duplicate check
Pipeline #90426 failed
This commit is part of merge request !21. Comments created here will be created in the context of that merge request.
...@@ -47,11 +47,5 @@ class PersonIdentitySerializer(serializers.ModelSerializer): ...@@ -47,11 +47,5 @@ class PersonIdentitySerializer(serializers.ModelSerializer):
return False return False
# If the type is a specific ID type, then duplicates are not expected # If the type is a specific ID type, then duplicates are not expected
return ( return PersonIdentity.objects.filter(type__like=identity_type).filter(
len( value__like=value).exists()
PersonIdentity.objects.filter(type__like=identity_type).filter(
value__like=value
)
)
> 0
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment