From a7d7cbd261718455d713549f59dc866fbf66ad71 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Mon, 15 Apr 2019 09:43:18 +0200 Subject: [PATCH] Add a logout confirmation This patch remove the custom rule in router responsible to redirect logout to index page and place a template with pre-translated strings. This is part of Aube patchset for Re2o to unify the login procedure with Django Contrib Auth. --- re2o/urls.py | 2 -- templates/registration/logged_out.html | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 templates/registration/logged_out.html diff --git a/re2o/urls.py b/re2o/urls.py index 2e18a863..fb6fcc6a 100644 --- a/re2o/urls.py +++ b/re2o/urls.py @@ -46,7 +46,6 @@ from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from django.contrib import admin -from django.contrib.auth import views as auth_views from django.views.generic import RedirectView from .views import index, about_page, contact_page @@ -58,7 +57,6 @@ urlpatterns = [ url(r'^$', index, name='index'), url(r'^about/$', about_page, name='about'), url(r'^contact/$', contact_page, name='contact'), - url('^logout/', auth_views.logout, {'next_page': '/'}), url('^', include('django.contrib.auth.urls')), url(r'^i18n/', include('django.conf.urls.i18n')), url(r'^admin/', include(admin.site.urls)), diff --git a/templates/registration/logged_out.html b/templates/registration/logged_out.html new file mode 100644 index 00000000..c3feb15d --- /dev/null +++ b/templates/registration/logged_out.html @@ -0,0 +1,18 @@ +{% extends "registration/logged_out.html" %} +{% comment %} +SPDX-License-Identifier: GPL-2.0-or-later + +Copyright © 2019 Alexandre Iooss +{% endcomment %} +{% load i18n %} + +{% block breadcrumbs %} + +{% endblock %} + +{% block content %} +

{% trans "Thanks for spending some quality time with the Web site today." %}

+

{% trans 'Log in again' %}

+{% endblock %}