Skip to content

Commit 083cdf3

Browse files
committed
Add new filter field, and patch the docs in AoC viewsets
- Add the possibility to filter by `is_blocked` in the AoC completionist block viewset. - Patch various tense, and formatting inconsistencies in AoC viewsets
1 parent 8c95f13 commit 083cdf3

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

pydis_site/apps/api/viewsets/bot/aoc_completionist_block.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class AocCompletionistBlockViewSet(
4242
4343
#### Status codes
4444
- 200: returned on success
45-
- 404: returned if an AoC completionist block with the given user__id was not found.
45+
- 404: returned if an AoC completionist block with the given `user__id` was not found.
4646
4747
### POST /bot/aoc-completionist-blocks
4848
Adds a single AoC completionist block
@@ -63,11 +63,11 @@ class AocCompletionistBlockViewSet(
6363
6464
#### Status codes
6565
- 204: returned on success
66-
- 404: if the AoC Completionist block with the given user__id does not exist
66+
- 404: returned if the AoC Completionist block with the given `user__id` was not found
6767
6868
"""
6969

7070
serializer_class = AocCompletionistBlockSerializer
7171
queryset = AocCompletionistBlock.objects.all()
7272
filter_backends = (DjangoFilterBackend,)
73-
filter_fields = ("user__id",)
73+
filter_fields = ("user__id", "is_blocked")

pydis_site/apps/api/viewsets/bot/aoc_link.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,19 @@ class AocAccountLinkViewSet(
2929
... ]
3030
3131
32-
### GET /bot/aoc-account-links<user__id:int>
32+
### GET /bot/aoc-account-links/<user__id:int>
3333
Retrieve a AoC account link by User ID
3434
3535
#### Response format
36-
>>> [
37-
... {
38-
... "user": 2,
39-
... "aoc_username": "AoCUser1"
40-
... },
41-
... ]
36+
>>>
37+
... {
38+
... "user": 2,
39+
... "aoc_username": "AoCUser1"
40+
... }
4241
4342
#### Status codes
4443
- 200: returned on success
45-
- 404: returned if an AoC account link with the given user__id was not found.
44+
- 404: returned if an AoC account link with the given `user__id` was not found.
4645
4746
### POST /bot/aoc-account-links
4847
Adds a single AoC account link block
@@ -55,14 +54,14 @@ class AocAccountLinkViewSet(
5554
5655
#### Status codes
5756
- 204: returned on success
58-
- 400: if one of the given fields is invalid
57+
- 400: if one of the given fields was invalid
5958
6059
### DELETE /bot/aoc-account-links/<user__id:int>
6160
Deletes the AoC account link item with the given `user__id`.
6261
6362
#### Status codes
6463
- 204: returned on success
65-
- 404: if the AoC account link with the given user__id does not exist
64+
- 404: returned if the AoC account link with the given `user__id` was not found
6665
6766
"""
6867

0 commit comments

Comments
 (0)