aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar SebastiaanZ <[email protected]>2019-07-12 10:18:55 +0200
committerGravatar SebastiaanZ <[email protected]>2019-07-12 10:18:55 +0200
commit115a181cd51f14cd9cf74168fdf5914cbcec51bc (patch)
tree298a798781f3cc738aaa957f6daa54d65f3f2d69
parentApply suggestions from code review (diff)
Changing logic so an end_reason can never be specified when updating an active nomination
-rw-r--r--pydis_site/apps/api/viewsets/bot/nomination.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pydis_site/apps/api/viewsets/bot/nomination.py b/pydis_site/apps/api/viewsets/bot/nomination.py
index 3595bec3..a9dacd68 100644
--- a/pydis_site/apps/api/viewsets/bot/nomination.py
+++ b/pydis_site/apps/api/viewsets/bot/nomination.py
@@ -194,7 +194,7 @@ class NominationViewSet(CreateModelMixin, RetrieveModelMixin, ListModelMixin, Ge
# There are three distinct PATCH scenarios we need to validate.
if instance.active and 'active' not in data:
# 1. We're updating an active nomination without ending it.
- if request.data.get('end_reason'):
+ if 'end_reason' in data:
raise ValidationError(
{'end_reason': ["An active nomination can't have an end reason."]}
)