aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RohanJnr <[email protected]>2021-05-19 13:15:53 +0530
committerGravatar RohanJnr <[email protected]>2021-05-19 13:15:53 +0530
commit8232b1115bdc308c7ca12f477c704957ec3e3ed1 (patch)
treec091cd33e5f213b06dfd00a3d31e4dda683a98e6
parentAdd active field to OffTopicChannelName model. (diff)
Serialize name and active attribute.
-rw-r--r--pydis_site/apps/api/serializers.py13
1 files changed, 1 insertions, 12 deletions
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):