aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/viewsets
diff options
context:
space:
mode:
authorGravatar bast <[email protected]>2021-05-30 16:00:24 -0700
committerGravatar bast <[email protected]>2021-05-30 16:00:24 -0700
commit45dfba505e04eec968a3be701e868753b8e4a849 (patch)
treebc4ba3be9827b1ea2589bf723a1629791acd5587 /pydis_site/apps/api/viewsets
parentRaise ValidationError for new bot/infractions filter if the types are invalid (diff)
Fix bot/infractions after and before filter check being inverted
The check was backwards, enforcing that no results must ever be returned Relevant tests have been added that actually fetch an infraction with the right times so that I'm sure it's not still broken
Diffstat (limited to 'pydis_site/apps/api/viewsets')
-rw-r--r--pydis_site/apps/api/viewsets/bot/infraction.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pydis_site/apps/api/viewsets/bot/infraction.py b/pydis_site/apps/api/viewsets/bot/infraction.py
index 00dd05b8..0baab6fd 100644
--- a/pydis_site/apps/api/viewsets/bot/infraction.py
+++ b/pydis_site/apps/api/viewsets/bot/infraction.py
@@ -195,7 +195,7 @@ class InfractionViewSet(
raise ValidationError({'expires_before': ['failed to convert to datetime']})
if 'expires_at__lte' in additional_filters and 'expires_at__gte' in additional_filters:
- if additional_filters['expires_at__gte'] < additional_filters['expires_at__lte']:
+ if additional_filters['expires_at__gte'] > additional_filters['expires_at__lte']:
raise ValidationError({
'expires_before': ['cannot be after expires_after'],
'expires_after': ['cannot be before expires_before'],