Fixed a problem with cancellations

This commit is contained in:
Raphael Michel
2016-04-10 16:01:55 +02:00
parent 403057f3e5
commit eafbe95370
2 changed files with 3 additions and 3 deletions

View File

@@ -110,7 +110,7 @@ class AsyncAction:
return JsonResponse({ return JsonResponse({
'ready': True, 'ready': True,
'redirect': self.get_success_url(value), 'redirect': self.get_success_url(value),
'message': self.get_success_message(value) 'message': str(self.get_success_message(value))
}) })
return redirect(self.get_success_url(value)) return redirect(self.get_success_url(value))
@@ -120,7 +120,7 @@ class AsyncAction:
return JsonResponse({ return JsonResponse({
'ready': True, 'ready': True,
'redirect': self.get_error_url(), 'redirect': self.get_error_url(),
'message': self.get_error_message(exception) 'message': str(self.get_error_message(exception))
}) })
return redirect(self.get_error_url()) return redirect(self.get_error_url())

View File

@@ -292,7 +292,7 @@ class OrderCancelDo(EventViewMixin, OrderDetailMixin, AsyncAction, View):
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
if not self.order: if not self.order:
raise Http404(_('Unknown order code or not authorized to access this order.')) raise Http404(_('Unknown order code or not authorized to access this order.'))
return self.do(self.order) return self.do(self.order.pk)
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
ctx = super().get_context_data(**kwargs) ctx = super().get_context_data(**kwargs)