From 2b6c47274717bfcf4bcffc0e4f3fb41c2a78ddfe Mon Sep 17 00:00:00 2001 From: Sebastiaan Zeeff <33516116+SebastiaanZ@users.noreply.github.com> Date: Thu, 4 Jul 2019 11:20:48 +0200 Subject: Apply suggestions from code review Co-Authored-By: Mark --- pydis_site/apps/api/viewsets/bot/nomination.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pydis_site') 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( -- cgit v1.2.3