aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site
diff options
context:
space:
mode:
Diffstat (limited to 'pydis_site')
-rw-r--r--pydis_site/apps/api/viewsets/bot/nomination.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/pydis_site/apps/api/viewsets/bot/nomination.py b/pydis_site/apps/api/viewsets/bot/nomination.py
index ecbf217e..49c40e7c 100644
--- a/pydis_site/apps/api/viewsets/bot/nomination.py
+++ b/pydis_site/apps/api/viewsets/bot/nomination.py
@@ -287,19 +287,15 @@ class NominationViewSet(CreateModelMixin, RetrieveModelMixin, ListModelMixin, Ge
)
# This is actually covered, but for some reason coverage don't think so.
- elif 'reviewed' in request.data: # pragma: no cover
- # 4. We are altering the reviewed state of the nomination.
- if not instance.active:
- raise ValidationError(
- {'reviewed': ['This field cannot be set if the nomination is inactive.']}
- )
+ elif not instance.active and 'reviewed' in request.data:
+ raise ValidationError(
+ {'reviewed': ['This field cannot be set if the nomination is inactive.']}
+ )
- elif 'thread_id' in request.data:
- # 5. We are altering the thread_id of the nomination.
- if not instance.active:
- raise ValidationError(
- {'thread_id': ['This field cannot be set if the nomination is inactive.']}
- )
+ elif not instance.active and 'thread_id' in request.data:
+ raise ValidationError(
+ {'thread_id': ['This field cannot be set if the nomination is inactive.']}
+ )
if 'reason' in request.data:
if 'actor' not in request.data: