mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
Fix migration of old hide_without_voucher products
This commit is contained in:
@@ -1483,6 +1483,12 @@ class ItemUpdateGeneral(ItemDetailMixin, EventPermissionRequiredMixin, MetaDataE
|
|||||||
messages.error(self.request, _('We could not save your changes. See below for details.'))
|
messages.error(self.request, _('We could not save your changes. See below for details.'))
|
||||||
return super().form_invalid(form)
|
return super().form_invalid(form)
|
||||||
|
|
||||||
|
def get_object(self, queryset=None) -> Item:
|
||||||
|
o = super().get_object(queryset)
|
||||||
|
if o.hide_without_voucher:
|
||||||
|
o.require_voucher = True
|
||||||
|
return o
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
ctx = super().get_context_data()
|
ctx = super().get_context_data()
|
||||||
ctx['plugin_forms'] = self.plugin_forms
|
ctx['plugin_forms'] = self.plugin_forms
|
||||||
@@ -1493,8 +1499,6 @@ class ItemUpdateGeneral(ItemDetailMixin, EventPermissionRequiredMixin, MetaDataE
|
|||||||
messages.info(self.request, _("You disabled this item, but it is still part of a product bundle. "
|
messages.info(self.request, _("You disabled this item, but it is still part of a product bundle. "
|
||||||
"Your participants won't be able to buy the bundle unless you remove this "
|
"Your participants won't be able to buy the bundle unless you remove this "
|
||||||
"item from it."))
|
"item from it."))
|
||||||
if ctx['item'].hide_without_voucher:
|
|
||||||
ctx['item'].require_voucher = True
|
|
||||||
|
|
||||||
ctx['sales_channels'] = get_all_sales_channels()
|
ctx['sales_channels'] = get_all_sales_channels()
|
||||||
return ctx
|
return ctx
|
||||||
|
|||||||
Reference in New Issue
Block a user