Skip to content

Commit

Permalink
Add reviewed to nomination filterset fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jb3 committed May 21, 2024
1 parent 80c27d1 commit 335b632
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pydis_site/apps/api/viewsets/bot/nomination.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class NominationViewSet(CreateModelMixin, RetrieveModelMixin, ListModelMixin, Ge
#### Query parameters
- **active** `bool`: whether the nomination is still active
- **reviewed** `bool`: whether the nomination has been voted on/is being voted on
- **user__id** `int`: snowflake of the user who received the nomination
- **ordering** `str`: comma-separated sequence of fields to order the returned results
Expand Down Expand Up @@ -172,7 +173,7 @@ class NominationViewSet(CreateModelMixin, RetrieveModelMixin, ListModelMixin, Ge
serializer_class = NominationSerializer
queryset = Nomination.objects.all().prefetch_related('entries')
filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter)
filterset_fields = ('user__id', 'active')
filterset_fields = ('user__id', 'active', 'reviewed')
frozen_on_create = ('ended_at', 'end_reason', 'active', 'inserted_at', 'reviewed')

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

0 comments on commit 335b632

Please sign in to comment.