Skip to content
Snippets Groups Projects
Commit 6b139807 authored by Jonas Braathen's avatar Jonas Braathen
Browse files

Fix linting errors

parent d6429379
No related branches found
No related tags found
1 merge request!41Identity model changes
Pipeline #91887 passed
......@@ -39,10 +39,10 @@ class IdentitySerializer(serializers.ModelSerializer):
# If the type is a specific ID type, then duplicates are not expected
return Identity.objects.filter(type=identity_type).filter(value=value).exists()
def validate(self, data):
if self.is_duplicate(data["type"], data["value"]):
def validate(self, attrs):
if self.is_duplicate(attrs["type"], attrs["value"]):
raise ValidationError("Identity already exists")
return data
return attrs
class ConsentTypeSerializerBrief(serializers.ModelSerializer):
......
......@@ -2,7 +2,6 @@ import datetime
from typing import Dict
import pytest
from django.core.exceptions import ValidationError
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.status import HTTP_200_OK
......
from datetime import datetime, timedelta
from datetime import timedelta
from functools import partial
import pytest
......
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