File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
docker-app/qfieldcloud/core Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 2525from django .contrib .admin .templatetags .admin_urls import admin_urlname
2626from django .contrib .admin .views .main import ChangeList
2727from django .contrib .auth .models import Group
28- from django .contrib .auth .views import redirect_to_login
28+ from django .contrib .auth .views import logout_then_login , redirect_to_login
2929from django .core .exceptions import PermissionDenied , ValidationError
3030from django .core .files .storage import storages
3131from django .db .models import Q , QuerySet
@@ -101,6 +101,12 @@ def login(
101101 request .GET .get ("next" , "" ), login_url = reverse (settings .LOGIN_URL )
102102 )
103103
104+ def logout ( # type: ignore[override]
105+ self , request : HttpRequest , extra_context : dict [str , Any ] | None = None
106+ ) -> HttpResponse :
107+ """Override the default Django admin logout view to redirect to the Allauth's logout view."""
108+ return logout_then_login (request )
109+
104110 # TODO consider adding a logout view to redirect to the Allauth's logout view, but then we lose the nice template we have right now.
105111
106112
Original file line number Diff line number Diff line change 1- .login-logo img {
2- width : 100% ;
3- }
4-
51.object-tools {
62 margin-bottom : 1rem ;
73}
You can’t perform that action at this time.
0 commit comments