aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/serializers.py
diff options
context:
space:
mode:
authorGravatar mbaruh <[email protected]>2022-10-08 01:18:59 +0300
committerGravatar mbaruh <[email protected]>2022-10-08 01:18:59 +0300
commite5d655a81f71c4b5bfb15d567bc11f88023e5879 (patch)
tree26be1f9c5c26df2bf29289ccd757e1202734a5e3 /pydis_site/apps/api/serializers.py
parentProperly add dm_embed to serializers (diff)
Add infraction channel setting
Diffstat (limited to 'pydis_site/apps/api/serializers.py')
-rw-r--r--pydis_site/apps/api/serializers.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pydis_site/apps/api/serializers.py b/pydis_site/apps/api/serializers.py
index 0dcbf2ee..83471ca2 100644
--- a/pydis_site/apps/api/serializers.py
+++ b/pydis_site/apps/api/serializers.py
@@ -148,6 +148,7 @@ ALWAYS_OPTIONAL_SETTINGS = (
'infraction_type',
'infraction_reason',
'infraction_duration',
+ 'infraction_channel',
)
REQUIRED_FOR_FILTER_LIST_SETTINGS = (
@@ -178,6 +179,7 @@ INFRACTION_AND_NOTIFICATION_FIELDS = (
"infraction_type",
"infraction_reason",
"infraction_duration",
+ "infraction_channel",
"dm_content",
"dm_embed"
)
@@ -230,6 +232,7 @@ class FilterSerializer(ModelSerializer):
'infraction_reason': {'allow_blank': True, 'allow_null': True, 'required': False},
'enabled_channels': {'allow_empty': True, 'allow_null': True, 'required': False},
'disabled_channels': {'allow_empty': True, 'allow_null': True, 'required': False},
+ 'enabled_categories': {'allow_empty': True, 'allow_null': True, 'required': False},
'disabled_categories': {'allow_empty': True, 'allow_null': True, 'required': False},
}
@@ -305,6 +308,7 @@ class FilterListSerializer(ModelSerializer):
'infraction_reason': {'allow_blank': True, 'allow_null': True, 'required': False},
'enabled_channels': {'allow_empty': True},
'disabled_channels': {'allow_empty': True},
+ 'enabled_categories': {'allow_empty': True},
'disabled_categories': {'allow_empty': True},
}
@@ -314,7 +318,7 @@ class FilterListSerializer(ModelSerializer):
queryset=FilterList.objects.all(),
fields=('name', 'list_type'),
message=(
- "A filterlist with the same name and type already exist."
+ "A filterlist with the same name and type already exists."
)
),
]