Skip to content

Commit 4c704b6

Browse files
authored
Merge pull request #1323 from python-discord/jb3/nominations/filter-on-reviewed
Add reviewed to nomination filterset fields
2 parents 80c27d1 + 335b632 commit 4c704b6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class NominationViewSet(CreateModelMixin, RetrieveModelMixin, ListModelMixin, Ge
2929
3030
#### Query parameters
3131
- **active** `bool`: whether the nomination is still active
32+
- **reviewed** `bool`: whether the nomination has been voted on/is being voted on
3233
- **user__id** `int`: snowflake of the user who received the nomination
3334
- **ordering** `str`: comma-separated sequence of fields to order the returned results
3435
@@ -172,7 +173,7 @@ class NominationViewSet(CreateModelMixin, RetrieveModelMixin, ListModelMixin, Ge
172173
serializer_class = NominationSerializer
173174
queryset = Nomination.objects.all().prefetch_related('entries')
174175
filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter)
175-
filterset_fields = ('user__id', 'active')
176+
filterset_fields = ('user__id', 'active', 'reviewed')
176177
frozen_on_create = ('ended_at', 'end_reason', 'active', 'inserted_at', 'reviewed')
177178

178179
def create(self, request: HttpRequest, *args, **kwargs) -> Response:

0 commit comments

Comments
 (0)