From 8232b1115bdc308c7ca12f477c704957ec3e3ed1 Mon Sep 17 00:00:00 2001 From: RohanJnr Date: Wed, 19 May 2021 13:15:53 +0530 Subject: Serialize name and active attribute. --- pydis_site/apps/api/serializers.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'pydis_site/apps/api/serializers.py') diff --git a/pydis_site/apps/api/serializers.py b/pydis_site/apps/api/serializers.py index f47bedca..8f61073e 100644 --- a/pydis_site/apps/api/serializers.py +++ b/pydis_site/apps/api/serializers.py @@ -207,18 +207,7 @@ class OffTopicChannelNameSerializer(ModelSerializer): """Metadata defined for the Django REST Framework.""" model = OffTopicChannelName - fields = ('name',) - - def to_representation(self, obj: OffTopicChannelName) -> str: - """ - Return the representation of this `OffTopicChannelName`. - - This only returns the name of the off topic channel name. As the model - only has a single attribute, it is unnecessary to create a nested dictionary. - Additionally, this allows off topic channel name routes to simply return an - array of names instead of objects, saving on bandwidth. - """ - return obj.name + fields = ('name', 'active') class ReminderSerializer(ModelSerializer): -- cgit v1.2.3