diff --git a/gas/templates/gas/base_form.html b/gas/templates/gas/base_form.html
index 130716c..450f044 100644
--- a/gas/templates/gas/base_form.html
+++ b/gas/templates/gas/base_form.html
@@ -20,7 +20,7 @@
{% block form_actions %}
{% if not is_popup %}
- - {% trans "Cancel" %}
+ - {% trans "Cancel" %}
{% endif %}
-
diff --git a/gas/views.py b/gas/views.py
index ace0295..e25c083 100644
--- a/gas/views.py
+++ b/gas/views.py
@@ -6,7 +6,6 @@ from django.core.exceptions import ImproperlyConfigured
from django.db import router
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseBadRequest
from django.urls import reverse
-from django.utils.encoding import force_text
from django.utils.html import escape, escapejs
from django.utils.text import capfirst
from django.utils.translation import gettext_lazy as _
@@ -107,10 +106,18 @@ class GASMixin:
def get_success_message(self):
return self.success_message
+ def get_cancel_url(self):
+ if self.cancel_url:
+ # Forcing possible reverse_lazy evaluation
+ url = str(self.cancel_url)
+ return url
+ else:
+ return self.get_success_url()
+
def get_continue_url(self):
if self.continue_url:
# Forcing possible reverse_lazy evaluation
- url = force_text(self.continue_url)
+ url = str(self.continue_url)
return url
else:
raise ImproperlyConfigured("No URL to redirect to. Provide a continue_url.")