mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Filter payment method sales channels when cloning event to new organizer (Z#23196085) (#5220)
This commit is contained in:
@@ -1084,6 +1084,7 @@ class Event(EventMixin, LoggedModel):
|
||||
s.product = item_map[s.product_id]
|
||||
s.save(force_insert=True)
|
||||
|
||||
valid_sales_channel_identifers = set(self.organizer.sales_channels.values_list("identifier", flat=True))
|
||||
skip_settings = (
|
||||
'ticket_secrets_pretix_sig1_pubkey',
|
||||
'ticket_secrets_pretix_sig1_privkey',
|
||||
@@ -1119,6 +1120,11 @@ class Event(EventMixin, LoggedModel):
|
||||
settings_to_save.append(s)
|
||||
except ValueError:
|
||||
pass
|
||||
elif s.key.startswith('payment_') and s.key.endswith('__restrict_to_sales_channels'):
|
||||
data = other.settings._unserialize(s.value, as_type=list)
|
||||
data = [ident for ident in data if ident in valid_sales_channel_identifers]
|
||||
s.value = other.settings._serialize(data)
|
||||
settings_to_save.append(s)
|
||||
else:
|
||||
settings_to_save.append(s)
|
||||
other.settings._objects.bulk_create(settings_to_save)
|
||||
|
||||
Reference in New Issue
Block a user