mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Replace Item.hidden_if_available with relationship to other Item (#3686)
* draft * Implementation that is closer to old one * Fix tests * Add tests * Update src/pretix/control/forms/item.py Co-authored-by: Richard Schreiber <schreiber@rami.io> * Review notes --------- Co-authored-by: Richard Schreiber <schreiber@rami.io>
This commit is contained in:
@@ -857,6 +857,10 @@ class Event(EventMixin, LoggedModel):
|
||||
v.item = i
|
||||
v.save(force_insert=True)
|
||||
|
||||
for i in self.items.filter(hidden_if_item_available__isnull=False):
|
||||
i.hidden_if_item_available = item_map[i.hidden_if_item_available_id]
|
||||
i.save()
|
||||
|
||||
for imv in ItemMetaValue.objects.filter(item__event=other):
|
||||
imv.pk = None
|
||||
imv.property = item_meta_properties_map[imv.property_id]
|
||||
|
||||
Reference in New Issue
Block a user