Removed unnecessary default argument from GET.get() call in LoginView.get_redirect_url().

The default argument is unnecessary because
url_has_allowed_host_and_scheme() returns False when its first argument
is "" or None, so get_redirect_url() still returns "".

This also aligns LoginView.get_redirect_url() and LogoutView.get_next_page().
This commit is contained in:
Aymeric Augustin 2022-04-16 18:35:30 +02:00 committed by Mariusz Felisiak
parent 5591a72571
commit 903702dfb1
1 changed files with 1 additions and 1 deletions

View File

@ -74,7 +74,7 @@ class LoginView(SuccessURLAllowedHostsMixin, FormView):
def get_redirect_url(self):
"""Return the user-originating redirect URL if it's safe."""
redirect_to = self.request.POST.get(
self.redirect_field_name, self.request.GET.get(self.redirect_field_name, "")
self.redirect_field_name, self.request.GET.get(self.redirect_field_name)
)
url_is_safe = url_has_allowed_host_and_scheme(
url=redirect_to,