mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
views: Fix failure in redirecting from language selection page
is_safe_url() expects allowed_hosts argument instead of host. This is an internal method. Found by reviewing the release notes for Django 2.0, 2.1 and 2.2. This should be final change needed for Django 2.2 support. Closes: #1518. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
8266d61192
commit
7dbdb8037a
@ -101,7 +101,8 @@ class LanguageSelectionView(FormView):
|
||||
"""Return the URL in the next parameter or home page."""
|
||||
redirect_to = self.request.GET.get(REDIRECT_FIELD_NAME, '')
|
||||
redirect_to = self.request.POST.get(REDIRECT_FIELD_NAME, redirect_to)
|
||||
if is_safe_url(url=redirect_to, host=self.request.get_host()):
|
||||
if is_safe_url(url=redirect_to,
|
||||
allowed_hosts={self.request.get_host()}):
|
||||
return redirect_to
|
||||
|
||||
return reverse('index')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user