From f93ae2f395d59220f36a80393fc4363812d9caff Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Sun, 3 Feb 2019 23:43:34 -0400 Subject: [PATCH] Don't override success_url everytime Only override success_url if self.get_post_object_action_url() provides an alternative. Signed-off-by: Roberto Rosario --- mayan/apps/common/mixins.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mayan/apps/common/mixins.py b/mayan/apps/common/mixins.py index 868052424d..0f62a23919 100644 --- a/mayan/apps/common/mixins.py +++ b/mayan/apps/common/mixins.py @@ -349,7 +349,11 @@ class ObjectActionMixin(object): request=self.request ) - self.success_url = self.get_post_object_action_url() + # Allow get_post_object_action_url to override the redirect URL with a + # calculated URL after all objects are processed. + success_url = self.get_post_object_action_url() + if success_url: + self.success_url = success_url class ObjectNameMixin(object):