From 546656e9f985fcff9e7283c4bac659da36db98ae Mon Sep 17 00:00:00 2001 From: chapeau Date: Sat, 15 Aug 2020 12:51:10 +0200 Subject: [PATCH] Fix of about page crash if no president or CGU file --- re2o/templates/re2o/about.html | 2 ++ re2o/views.py | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/re2o/templates/re2o/about.html b/re2o/templates/re2o/about.html index 03b8beca..b69a8c15 100644 --- a/re2o/templates/re2o/about.html +++ b/re2o/templates/re2o/about.html @@ -43,8 +43,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,

{% trans "Publication manager" %}

{{ president }} - {% trans "President of " %} {{ option.pseudo }}

+ {% if gtu %}

{% trans "General Terms of Use" %}

{{ gtu }}

+ {% endif %} {% if option.description %}

{% trans "Additional information" %}

diff --git a/re2o/views.py b/re2o/views.py index 6a65bcec..3897f4a3 100644 --- a/re2o/views.py +++ b/re2o/views.py @@ -115,13 +115,18 @@ def about_page(request): dependencies = settings.INSTALLED_APPS + settings.MIDDLEWARE_CLASSES + try: + president = Mandate.get_mandate().president.get_full_name() + except: + president = _("Unable to get the information.") + return render( request, "re2o/about.html", { "option": option, "gtu": general.GTU, - "president": Mandate.get_mandate().president.get_full_name(), + "president": president, "git_info_contributors": git_info_contributors, "git_info_remote": git_info_remote, "git_info_branch": git_info_branch,