diff options
author | 2019-07-12 10:18:55 +0200 | |
---|---|---|
committer | 2019-07-12 10:18:55 +0200 | |
commit | 115a181cd51f14cd9cf74168fdf5914cbcec51bc (patch) | |
tree | 298a798781f3cc738aaa957f6daa54d65f3f2d69 /pydis_site | |
parent | Apply suggestions from code review (diff) |
Changing logic so an end_reason can never be specified when updating an active nomination
Diffstat (limited to 'pydis_site')
-rw-r--r-- | pydis_site/apps/api/viewsets/bot/nomination.py | 2 |
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."]} ) |