Skip to content
Snippets Groups Projects
Commit 3113bfc2 authored by Bastien Abadie's avatar Bastien Abadie
Browse files

Merge branch 'fix-repo-search-500' into 'master'

Fix 500 errors when opening the repo search API endpoint with a browser

See merge request !225
parents 2c8037e2 c6118613
No related branches found
No related tags found
1 merge request!225Fix 500 errors when opening the repo search API endpoint with a browser
......@@ -222,11 +222,16 @@ class RepositorySerializer(serializers.ModelSerializer):
}
class ExternalRepositorySerializer(serializers.BaseSerializer):
class ExternalRepositorySerializer(serializers.Serializer):
"""
Serialize a Git repository from an external API
"""
# Useless fields, added to prevent 500 errors when opening
# an API endpoint in the browser
id = serializers.IntegerField(min_value=0)
corpus = serializers.UUIDField()
def to_representation(self, obj):
if isinstance(obj, gitlab.v4.objects.Project):
return {
......
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