forked from CGM_Public/pretix_original
Refs #928 -- Allow to regenerate secrets of specific tickets
This commit is contained in:
@@ -206,6 +206,7 @@ class OrderPositionChangeForm(forms.Form):
|
||||
('subevent', 'Change event date'),
|
||||
('cancel', 'Remove product'),
|
||||
('split', 'Split into new order'),
|
||||
('secret', 'Regenerate secret'),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -82,6 +82,10 @@ def _display_order_changed(event: Event, logentry: LogEntry):
|
||||
item=item,
|
||||
price=money_filter(Decimal(data['price']), event.currency),
|
||||
)
|
||||
elif logentry.action_type == 'pretix.event.order.changed.secret':
|
||||
return text + ' ' + _('A new secret has been generated for position #{posid}.').format(
|
||||
posid=data.get('positionid', '?'),
|
||||
)
|
||||
elif logentry.action_type == 'pretix.event.order.changed.split':
|
||||
old_item = str(event.items.get(pk=data['old_item']))
|
||||
if data['old_variation']:
|
||||
|
||||
@@ -131,6 +131,13 @@
|
||||
{% trans "Split into new order" %}
|
||||
</label>
|
||||
</div>
|
||||
<div class="radio">
|
||||
<label>
|
||||
<input name="{{ position.form.prefix }}-operation" type="radio" value="secret"
|
||||
{% if position.form.operation.value == "secret" %}checked="checked"{% endif %}>
|
||||
{% trans "Generate a new secret" %}
|
||||
</label>
|
||||
</div>
|
||||
<div class="radio">
|
||||
<label>
|
||||
<input name="{{ position.form.prefix }}-operation" type="radio" value="cancel"
|
||||
|
||||
@@ -631,6 +631,8 @@ class OrderChange(OrderView):
|
||||
ocm.cancel(p)
|
||||
elif p.form.cleaned_data['operation'] == 'split':
|
||||
ocm.split(p)
|
||||
elif p.form.cleaned_data['operation'] == 'secret':
|
||||
ocm.regenerate_secret(p)
|
||||
|
||||
except OrderError as e:
|
||||
p.custom_error = str(e)
|
||||
|
||||
Reference in New Issue
Block a user