views: prevent None success URL in unlink view (fixes #24708)

Logout URL to FC can be None if the current session was not opened
through an FC authentication.
This commit is contained in:
Benjamin Dauvergne 2018-06-22 15:39:50 +02:00
parent 25d6187305
commit 0a8628ae54
1 changed files with 2 additions and 1 deletions

View File

@ -472,7 +472,8 @@ class UnlinkView(LoggerMixin, FormView):
def get_success_url(self):
url = reverse('account_management')
if app_settings.logout_when_unlink:
url = utils.build_logout_url(self.request, next_url=url)
# logout URL can be None if not session exists with FC
url = utils.build_logout_url(self.request, next_url=url) or url
return url
def get_form_class(self):