aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/viewsets
diff options
context:
space:
mode:
authorGravatar D0rs4n <[email protected]>2021-12-09 20:53:49 +0100
committerGravatar D0rs4n <[email protected]>2021-12-18 18:02:12 +0100
commit3e8f164525bdd3a728bb7383da237feb9aacb44e (patch)
treefb86c93de377bb200d036b609f464b0fc2b574da /pydis_site/apps/api/viewsets
parentAdjust FilterList Representation (diff)
Adjust FilterList Schema to group settings into subcategories
- This commit patches the FilterList serializer's schema, and puts the settings into the relevant subcategories.
Diffstat (limited to 'pydis_site/apps/api/viewsets')
-rw-r--r--pydis_site/apps/api/viewsets/bot/filters.py93
1 files changed, 46 insertions, 47 deletions
diff --git a/pydis_site/apps/api/viewsets/bot/filters.py b/pydis_site/apps/api/viewsets/bot/filters.py
index cbadcf2b..2b587696 100644
--- a/pydis_site/apps/api/viewsets/bot/filters.py
+++ b/pydis_site/apps/api/viewsets/bot/filters.py
@@ -52,31 +52,29 @@ class FilterListViewSet(ModelViewSet):
... },
... ...
... ],
- ... "settings": {
- ... "dm_content": None,
- ... "infraction_type": None,
- ... "infraction_reason": "",
- ... "infraction_duration": None,
- ... "ping_type": [
- ... "onduty"
- ... ],
- ... "filter_dm": True,
- ... "dm_ping_type": [
- ... "onduty"
- ... ],
- ... "delete_messages": True,
- ... "bypass_roles": [
- ... 267630620367257601
- ... ],
- ... "enabled": False,
- ... "disallowed_channels": [],
- ... "disallowed_categories": [],
- ... "allowed_channels": [],
- ... "allowed_categories": []
- ... }
- ... },
- ... ...
- ... ]
+ ... "settings": {
+ ... "ping_type": [
+ ... "onduty"
+ ... ],
+ ... "dm_ping_type": [
+ ... "onduty"
+ ... ],
+ ... "bypass_roles": [
+ ... 267630620367257601
+ ... ],
+ ... "filter_dm": True,
+ ... "infraction": {
+ ... "infraction_type": None,
+ ... "infraction_reason": "",
+ ... "infraction_duration": None,
+ ... }
+ ... "channel_scope": {
+ ... "disallowed_channels": [],
+ ... "disallowed_categories": [],
+ ... "allowed_channels": [],
+ ... "allowed_categories": []
+ ... }
+ ... }
#### Status codes
- 200: returned on success
@@ -120,28 +118,29 @@ class FilterListViewSet(ModelViewSet):
...
... ],
... "settings": {
- ... "dm_content": None,
- ... "infraction_type": None,
- ... "infraction_reason": "",
- ... "infraction_duration": None,
- ... "ping_type": [
- ... "onduty"
- ... ],
- ... "filter_dm": True,
- ... "dm_ping_type": [
- ... "onduty"
- ... ],
- ... "delete_messages": True,
- ... "bypass_roles": [
- ... 267630620367257601
- ... ],
- ... "enabled": False,
- ... "disallowed_channels": [],
- ... "disallowed_categories": [],
- ... "allowed_channels": [],
- ... "allowed_categories": []
- ... }
- ... }
+ ... "ping_type": [
+ ... "onduty"
+ ... ],
+ ... "dm_ping_type": [
+ ... "onduty"
+ ... ],
+ ... "bypass_roles": [
+ ... 267630620367257601
+ ... ],
+ ... "filter_dm": True,
+ ... "infraction": {
+ ... "infraction_type": None,
+ ... "infraction_reason": "",
+ ... "infraction_duration": None,
+ ... }
+ ... "channel_scope": {
+ ... "disallowed_channels": [],
+ ... "disallowed_categories": [],
+ ... "allowed_channels": [],
+ ... "allowed_categories": []
+ ... }
+ ... }
+ ... }
#### Status codes
- 200: returned on success