mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Use "cancel" method instead of "refund" for free orders (#743)
* Use "cancel" method instead of "refund" for free orders * Adjust API
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
{% trans "Extend payment term" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if order.status == 'n' %}
|
||||
{% if order.cancel_allowed %}
|
||||
<a href="{% url "control:event.order.transition" event=request.event.slug organizer=request.event.organizer.slug code=order.code %}?status=c" class="btn btn-default">
|
||||
{% trans "Cancel order" %}
|
||||
</a>
|
||||
|
||||
@@ -219,7 +219,7 @@ class OrderTransition(OrderView):
|
||||
messages.warning(self.request, _('The order has been marked as paid, but we were unable to send a confirmation mail.'))
|
||||
else:
|
||||
messages.success(self.request, _('The order has been marked as paid.'))
|
||||
elif self.order.status == Order.STATUS_PENDING and to == 'c':
|
||||
elif self.order.cancel_allowed() and to == 'c':
|
||||
cancel_order(self.order, user=self.request.user, send_mail=self.request.POST.get("send_email") == "on")
|
||||
messages.success(self.request, _('The order has been canceled.'))
|
||||
elif self.order.status == Order.STATUS_PAID and to == 'n':
|
||||
@@ -241,7 +241,7 @@ class OrderTransition(OrderView):
|
||||
|
||||
def get(self, *args, **kwargs):
|
||||
to = self.request.GET.get('status', '')
|
||||
if self.order.status == Order.STATUS_PENDING and to == 'c':
|
||||
if self.order.cancel_allowed() and to == 'c':
|
||||
return render(self.request, 'pretixcontrol/order/cancel.html', {
|
||||
'order': self.order,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user