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().
@@ -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,
