diff options
author | 2020-07-15 15:34:30 +0200 | |
---|---|---|
committer | 2020-07-15 15:34:30 +0200 | |
commit | 90f325fe94af4a771ea4ed0ddfc5a074d0e88c07 (patch) | |
tree | 1ff9bb4b8b263f18468c5ff96d123aebc01969ed | |
parent | Add a UniqueConstraint to prevent duplicates. (diff) |
Return id from the AllowListSerializer.
https://github.com/python-discord/site/issues/305
-rw-r--r-- | pydis_site/apps/api/serializers.py | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/pydis_site/apps/api/serializers.py b/pydis_site/apps/api/serializers.py index 24ba0ec0..13030074 100644 --- a/pydis_site/apps/api/serializers.py +++ b/pydis_site/apps/api/serializers.py @@ -4,13 +4,20 @@ from rest_framework.validators import UniqueTogetherValidator from rest_framework_bulk import BulkSerializerMixin from .models import ( - BotSetting, DeletedMessage, - DocumentationLink, Infraction, - LogEntry, MessageDeletionContext, - Nomination, OffTopicChannelName, - OffensiveMessage, AllowList, - Reminder, Role, - Tag, User + AllowList, + BotSetting, + DeletedMessage, + DocumentationLink, + Infraction, + LogEntry, + MessageDeletionContext, + Nomination, + OffTopicChannelName, + OffensiveMessage, + Reminder, + Role, + Tag, + User, ) @@ -104,7 +111,7 @@ class AllowListSerializer(ModelSerializer): """Metadata defined for the Django REST Framework.""" model = AllowList - fields = ('created_at', 'updated_at', 'type', 'allowed', 'content') + fields = ('id', 'created_at', 'updated_at', 'type', 'allowed', 'content') class InfractionSerializer(ModelSerializer): |