diff --git a/src/pretix/control/forms/item.py b/src/pretix/control/forms/item.py index a53e71af0..978e35ac6 100644 --- a/src/pretix/control/forms/item.py +++ b/src/pretix/control/forms/item.py @@ -196,7 +196,7 @@ class ItemCreateForm(I18nModelForm): instance = super().save(*args, **kwargs) - if not self.event.has_subevents: + if not self.event.has_subevents and not self.cleaned_data.get('has_variations'): if self.cleaned_data.get('quota_option') == self.EXISTING and self.cleaned_data.get('quota_add_existing') is not None: quota = self.cleaned_data.get('quota_add_existing') quota.items.add(self.instance) diff --git a/src/pretix/static/pretixcontrol/js/ui/hidequota.js b/src/pretix/static/pretixcontrol/js/ui/hidequota.js index a812b1f0b..39326fa99 100644 --- a/src/pretix/static/pretixcontrol/js/ui/hidequota.js +++ b/src/pretix/static/pretixcontrol/js/ui/hidequota.js @@ -26,4 +26,11 @@ $(document).ready(function () { hideDeselected(true); } ); + + function toggleblock() { + $("#new-quota-group").closest('fieldset').toggle(!$("#id_has_variations").prop('checked')); + } + + $("#id_has_variations").change(toggleblock); + toggleblock(); });