API: Minor robustness improvements in quota and checkinlist serializers

This commit is contained in:
Raphael Michel
2022-02-17 17:36:33 +01:00
parent 06ffa0bcd5
commit 98409b0a22
2 changed files with 2 additions and 2 deletions

View File

@@ -1697,7 +1697,7 @@ class Quota(LoggedModel):
if event != item.event:
raise ValidationError(_('One or more items do not belong to this event.'))
if item.has_variations:
if not any(var.item == item for var in variations):
if not variations or not any(var.item == item for var in variations):
raise ValidationError(_('One or more items has variations but none of these are in the variations list.'))
@staticmethod