Skip to content

Commit

Permalink
fixup! allow override of redirect url via "redirect" param [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
simahawk committed Mar 24, 2017
1 parent dd52920 commit 81af2bf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cms_form/models/cms_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ def form_next_url(self, main_object=None):

def form_cancel_url(self, main_object=None):
"""URL to redirect to after click on "cancel" button."""
if self.request.args.get('redirect'):
# redirect overridden
return self.request.args.get('redirect')
main_object = main_object or self.main_object
if main_object and 'website_url' in main_object:
return main_object.website_url
Expand Down

0 comments on commit 81af2bf

Please sign in to comment.