Skip to content
Snippets Groups Projects
Commit 4b846d84 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[common][serializers] Fix object existence check

The check worked with SQLite but not with PostgreSQL.
In any case, since we have a user object here, there's no
reason to not use it directly.
parent 2293d3c4
No related branches found
No related tags found
1 merge request!326Fix object existence check in common serialiser
Pipeline #38982 passed
......@@ -351,7 +351,7 @@ class ContributionCreationSerializer(serializers.ModelSerializer):
)
if self.Meta.model.objects.filter(
author__username__iexact=user, name=name, version=version
author=user, name=name, version=version
).exists():
raise serializers.ValidationError(
"{} {} version {} already exists on this account".format(
......
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