mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Do not create duplicate memberships on order changes (Z#23163336) (#4408)
This commit is contained in:
@@ -151,6 +151,12 @@
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
{% bootstrap_field position.form.itemvar layout='inline' %}
|
||||
{% if position.granted_memberships.all %}
|
||||
<span class="text-muted">
|
||||
<span class="fa fa-warning text-warning" aria-hidden="true"></span>
|
||||
{% trans "The sale of this position created a membership. Changing the product here will not affect the membership. Memberships can be managed in the customer account." %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -254,6 +260,12 @@
|
||||
{% trans "–" %}
|
||||
</div>
|
||||
{% bootstrap_field position.form.valid_until layout='inline' %}
|
||||
{% if position.granted_memberships.all %}
|
||||
<span class="text-muted">
|
||||
<span class="fa fa-warning text-warning" aria-hidden="true"></span>
|
||||
{% trans "The sale of this position created a membership. Changing the validity of the ticket here will not affect the membership. Memberships can be managed in the customer account." %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1900,7 +1900,7 @@ class OrderChange(OrderView):
|
||||
positions = list(self.order.positions.select_related(
|
||||
'item', 'item__tax_rule', 'used_membership', 'used_membership__membership_type', 'tax_rule',
|
||||
'seat', 'subevent',
|
||||
))
|
||||
).prefetch_related('granted_memberships'))
|
||||
for p in positions:
|
||||
p.form = OrderPositionChangeForm(prefix='op-{}'.format(p.pk), instance=p, items=self.items,
|
||||
initial={'seat': p.seat.seat_guid if p.seat else None},
|
||||
|
||||
Reference in New Issue
Block a user