Merge pull request #201 from rixx/ticket165_reactivate_voucher

Fix #165 -- Reactivate voucher on cancelled orders
This commit is contained in:
Raphael Michel
2016-08-29 21:15:10 +02:00
committed by GitHub
4 changed files with 34 additions and 5 deletions

View File

@@ -295,7 +295,7 @@ class OrderCancel(EventViewMixin, OrderDetailMixin, TemplateView):
self.kwargs = kwargs
if not self.order:
raise Http404(_('Unknown order code or not authorized to access this order.'))
if self.order.status not in (Order.STATUS_PENDING, Order.STATUS_EXPIRED) or not self.order.can_user_cancel:
if self.order.status != Order.STATUS_PENDING or not self.order.can_user_cancel:
messages.error(request, _('You cannot cancel this order.'))
return redirect(self.get_order_url())
return super().dispatch(request, *args, **kwargs)