aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/viewsets
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2021-06-08 00:26:40 +0200
committerGravatar Johannes Christ <[email protected]>2021-06-08 00:29:59 +0200
commitc998d475440cf4819bad7ebc3ed19f31ce82baf4 (patch)
treebfdeba9a483ebb7646171c79f5b259c27f3d17dd /pydis_site/apps/api/viewsets
parentFix `content` app tests not running on macOS (#519) (diff)
Move subdomains to query paths.
In more detail: - Use Django URL namespaces (e.g. `api:bot:infractions`) instead of `django_hosts` host argument. - Update the hosts file setup documentation to remove subdomain entries. - Update the hosts file setup documentation to mention that the entry of `pythondiscord.local` is not required and mainly for convenience. - Rename the `APISubdomainTestCase` to the more fitting `AuthenticatedAPITestCase`, as authentication is all that is left that the class is doing. - Drop dependency to `django_hosts`.
Diffstat (limited to 'pydis_site/apps/api/viewsets')
-rw-r--r--pydis_site/apps/api/viewsets/bot/off_topic_channel_name.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pydis_site/apps/api/viewsets/bot/off_topic_channel_name.py b/pydis_site/apps/api/viewsets/bot/off_topic_channel_name.py
index 826ad25e..922e6555 100644
--- a/pydis_site/apps/api/viewsets/bot/off_topic_channel_name.py
+++ b/pydis_site/apps/api/viewsets/bot/off_topic_channel_name.py
@@ -20,7 +20,7 @@ class OffTopicChannelNameViewSet(DestroyModelMixin, ViewSet):
### GET /bot/off-topic-channel-names
Return all known off-topic channel names from the database.
If the `random_items` query parameter is given, for example using...
- $ curl api.pythondiscord.local:8000/bot/off-topic-channel-names?random_items=5
+ $ curl 127.0.0.1:8000/api/bot/off-topic-channel-names?random_items=5
... then the API will return `5` random items from the database
that is not used in current rotation.
When running out of names, API will mark all names to not used and start new rotation.
@@ -39,7 +39,7 @@ class OffTopicChannelNameViewSet(DestroyModelMixin, ViewSet):
### POST /bot/off-topic-channel-names
Create a new off-topic-channel name in the database.
The name must be given as a query parameter, for example:
- $ curl api.pythondiscord.local:8000/bot/off-topic-channel-names?name=lemons-lemonade-shop
+ $ curl 127.0.0.1:8000/api/bot/off-topic-channel-names?name=lemons-lemonade-shop
#### Status codes
- 201: returned on success