From ceb2c86d74ae601de65a3c50ca36f5dcc2427215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Kervella?= Date: Fri, 22 Jun 2018 19:06:06 +0000 Subject: [PATCH] Fix #60: Change context variable so it does not get overriden by django-auth views --- re2o/context_processors.py | 4 +++- re2o/locale/fr/LC_MESSAGES/django.mo | Bin 3926 -> 3932 bytes re2o/locale/fr/LC_MESSAGES/django.po | 4 ++-- re2o/templates/re2o/index.html | 2 +- templates/base.html | 4 ++-- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/re2o/context_processors.py b/re2o/context_processors.py index 5a34e34b..a2e205c2 100644 --- a/re2o/context_processors.py +++ b/re2o/context_processors.py @@ -42,6 +42,8 @@ def context_user(request): return { 'request_user': user, 'interfaces': interfaces, - 'site_name': GeneralOption.get_cached_value('site_name'), + # Must takes a different name because djang.auth.contrib.views.login() + # overrides 'site_name' context variable. + 'name_website': GeneralOption.get_cached_value('site_name'), 'ipv6_enabled': OptionalMachine.get_cached_value('ipv6'), } diff --git a/re2o/locale/fr/LC_MESSAGES/django.mo b/re2o/locale/fr/LC_MESSAGES/django.mo index b32956f897df66459b4b7b258a7f85d72b74c854..355c388c95015b2eb73de9597bf85e58c4d570e4 100644 GIT binary patch delta 217 zcmYk!zYf7r7zOZi6H@{BnH#(J16|>Rc22DCF)a? z&S` delta 222 zcmca3cTH}>ntCY)28L#K1_lF028MY++6%}(&%wYD2Bf7p85lf)bRm%T2hzKNv?B`x z12-1~g9MQ8%g4YV0Ho7^v^bD12hu!1x*tdbjbfMsq=8x(mH=s>kqqmg;@g3=JdnSi zk3o(>2FSP%6i@=ve}FW|V0nH923a6&G1-$boKbl4LPl|rez2jFFLKClzR$Rkm7_Sb YBsD%SF?aK9_6_WOFkY%=v4SE40CM6YdjJ3c diff --git a/re2o/locale/fr/LC_MESSAGES/django.po b/re2o/locale/fr/LC_MESSAGES/django.po index 3958eac6..ea5c1b11 100644 --- a/re2o/locale/fr/LC_MESSAGES/django.po +++ b/re2o/locale/fr/LC_MESSAGES/django.po @@ -44,8 +44,8 @@ msgstr "Accueil" #: templates/re2o/index.html:33 #, python-format -msgid "Welcome to %(site_name)s !" -msgstr "Bienvenue sur %(site_name)s !" +msgid "Welcome to %(name_website)s !" +msgstr "Bienvenue sur %(name_website)s !" #: templates/re2o/index.html:47 msgid "Go there" diff --git a/re2o/templates/re2o/index.html b/re2o/templates/re2o/index.html index 2e8de080..5b505c0f 100644 --- a/re2o/templates/re2o/index.html +++ b/re2o/templates/re2o/index.html @@ -30,7 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block title %}{% trans "Home" %}{% endblock %} {% block content %} -

{% blocktrans %}Welcome to {{ site_name }} !{% endblocktrans %}

+

{% blocktrans %}Welcome to {{ name_website }} !{% endblocktrans %}

{% for service_list in services_urls %} diff --git a/templates/base.html b/templates/base.html index 45c1e6a4..0f4d6d59 100644 --- a/templates/base.html +++ b/templates/base.html @@ -56,7 +56,7 @@ with this program; if not, write to the Free Software Foundation, Inc., - {{ site_name }} : {% block title %}Accueil{% endblock %} + {{ name_website }} : {% block title %}Accueil{% endblock %} @@ -71,7 +71,7 @@ with this program; if not, write to the Free Software Foundation, Inc., - {{ site_name }} + {{ name_website }}