Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Validate `name` field to replace `IntegrityError`s with 400 response (#2190)
Dhruv Bhanushali258a23298ab9
diff --git a/api/api/serializers/oauth2_serializers.py b/api/api/serializers/oauth2_serializers.pyindex d5300bd5f..0a79968c9 100644--- a/api/api/serializers/oauth2_serializers.py+++ b/api/api/serializers/oauth2_serializers.py@@ -6,32 +6,6 @@ from api.models import OAuth2Registrationclass OAuth2RegistrationSerializer(serializers.ModelSerializer):- name = serializers.CharField(- help_text=(- "A unique human-readable name for your application or project "- "requiring access to the Openverse API."- ),- required=True,- min_length=1,- max_length=150,- )- description = serializers.CharField(- help_text=(- "A description of what you are trying to achieve with your project "- "using the API. Please provide as much detail as possible!"- ),- min_length=1,- max_length=10000,- )- email = serializers.EmailField(- help_text=(- "A valid email that we can reach you at if we have any questions "- "about your use case or data consumption."- ),- min_length=1,- max_length=254,- )-class Meta:model = OAuth2Registrationfields = ("name", "description", "email")