diff options
author | 2019-07-04 11:20:48 +0200 | |
---|---|---|
committer | 2019-07-04 11:20:48 +0200 | |
commit | 2b6c47274717bfcf4bcffc0e4f3fb41c2a78ddfe (patch) | |
tree | 8920a8c07c32907f9a9a1f579c02ebd5ea002ad6 | |
parent | Move end nomination operation to PATCH endpoint (diff) |
Apply suggestions from code review
Co-Authored-By: Mark <[email protected]>
-rw-r--r-- | pydis_site/apps/api/viewsets/bot/nomination.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pydis_site/apps/api/viewsets/bot/nomination.py b/pydis_site/apps/api/viewsets/bot/nomination.py index fad16aa5..3595bec3 100644 --- a/pydis_site/apps/api/viewsets/bot/nomination.py +++ b/pydis_site/apps/api/viewsets/bot/nomination.py @@ -103,7 +103,7 @@ class NominationViewSet(CreateModelMixin, RetrieveModelMixin, ListModelMixin, Ge 3. Updating the `end_reason` or `reason` field of an `inactive` nomination. While the response format and status codes are the same for all three operations (see - below), the request bodies vary depending on the operation. For all operations holds + below), the request bodies vary depending on the operation. For all operations it holds that providing other valid fields is not allowed and invalid fields are ignored. ### 1. Updating the `reason` of `active` nomination @@ -199,7 +199,7 @@ class NominationViewSet(CreateModelMixin, RetrieveModelMixin, ListModelMixin, Ge {'end_reason': ["An active nomination can't have an end reason."]} ) - elif instance.active and not data.get('active'): + elif instance.active and not data['active']: # 2. We're ending an active nomination. if 'reason' in data: raise ValidationError( |