diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2022-04-16 18:53:46 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-04-20 10:04:29 +0200 |
| commit | 5b8699e723d9daf373fff46c6859fed2b780a9bd (patch) | |
| tree | ca68674f8fe6a5bd7b7ace2625da3739baa35c37 | |
| parent | 12576bd371c96fcc92f47a3df806531ff10450c6 (diff) | |
Renamed LogoutView.get_next_page() to get_success_url().
This aligns it with LoginView. Also, it removes confusion with the
get_next_page() method of paginators. get_next_page() was a private
API, therefore this refactoring is allowed.
| -rw-r--r-- | django/contrib/auth/views.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/django/contrib/auth/views.py b/django/contrib/auth/views.py index fa6f4f4cc4..25d987d0dc 100644 --- a/django/contrib/auth/views.py +++ b/django/contrib/auth/views.py @@ -142,16 +142,16 @@ class LogoutView(RedirectURLMixin, TemplateView): def post(self, request, *args, **kwargs): """Logout may be done via POST.""" auth_logout(request) - next_page = self.get_next_page() - if next_page: + redirect_to = self.get_success_url() + if redirect_to: # Redirect to this page until the session has been cleared. - return HttpResponseRedirect(next_page) + return HttpResponseRedirect(redirect_to) return super().get(request, *args, **kwargs) # RemovedInDjango50Warning. get = post - def get_next_page(self): + def get_success_url(self): if self.next_page is not None: next_page = resolve_url(self.next_page) elif settings.LOGOUT_REDIRECT_URL: |
