API: Fix crash on invalid input (PRETIXEU-5A9)

This commit is contained in:
Raphael Michel
2021-09-14 15:02:06 +02:00
parent 7f6d234b4c
commit 2e0592b0a6

View File

@@ -1620,6 +1620,8 @@ class Quota(LoggedModel):
@staticmethod
def clean_items(event, items, variations):
if not items:
return
for item in items:
if event != item.event:
raise ValidationError(_('One or more items do not belong to this event.'))