aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/serializers.py
diff options
context:
space:
mode:
authorGravatar mbaruh <[email protected]>2022-11-05 15:20:14 +0200
committerGravatar mbaruh <[email protected]>2022-11-05 15:20:14 +0200
commit649fbc4799082f6ad5d9f986c86ca37ae6fe859d (patch)
tree52e31beaef2bc1654fcf898b6a35e89daaa9627e /pydis_site/apps/api/serializers.py
parentStop using None as a valid setting value (diff)
Add creation and update timestamps to filtering models
This is to support auto-infractions reporting (bot 7fcec400)
Diffstat (limited to 'pydis_site/apps/api/serializers.py')
-rw-r--r--pydis_site/apps/api/serializers.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pydis_site/apps/api/serializers.py b/pydis_site/apps/api/serializers.py
index a902523e..d6bae2cb 100644
--- a/pydis_site/apps/api/serializers.py
+++ b/pydis_site/apps/api/serializers.py
@@ -181,8 +181,8 @@ ALLOW_EMPTY_SETTINGS = (
)
# Required fields for custom JSON representation purposes
-BASE_FILTER_FIELDS = ('id', 'content', 'description', 'additional_field')
-BASE_FILTERLIST_FIELDS = ('id', 'name', 'list_type')
+BASE_FILTER_FIELDS = ('id', 'created_at', 'updated_at', 'content', 'description', 'additional_field')
+BASE_FILTERLIST_FIELDS = ('id', 'created_at', 'updated_at', 'name', 'list_type')
BASE_SETTINGS_FIELDS = (
"bypass_roles",
"filter_dm",
@@ -253,7 +253,7 @@ class FilterSerializer(ModelSerializer):
model = Filter
fields = (
- 'id', 'content', 'description', 'additional_field', 'filter_list'
+ 'id', 'created_at', 'updated_at', 'content', 'description', 'additional_field', 'filter_list'
) + SETTINGS_FIELDS
extra_kwargs = _create_filter_meta_extra_kwargs()
@@ -331,7 +331,7 @@ class FilterListSerializer(ModelSerializer):
"""Metadata defined for the Django REST Framework."""
model = FilterList
- fields = ('id', 'name', 'list_type', 'filters') + SETTINGS_FIELDS
+ fields = ('id', 'created_at', 'updated_at', 'name', 'list_type', 'filters') + SETTINGS_FIELDS
extra_kwargs = _create_filter_list_meta_extra_kwargs()
# Ensure there can only be one filter list with the same name and type.