8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-22 23:13:46 +00:00

Fix of about page crash if no president or CGU file

This commit is contained in:
chapeau 2020-08-15 12:51:10 +02:00
parent 7535050d4f
commit f5de596dff
2 changed files with 8 additions and 1 deletions

View file

@ -43,8 +43,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<h4>{% trans "Publication manager" %}</h4>
<p>{{ president }} - {% trans "President of " %} {{ option.pseudo }}</p>
{% if gtu %}
<h4>{% trans "General Terms of Use" %}</h4>
<p><a href='{{ gtu.url }}' download='CGU'>{{ gtu }}</a></p>
{% endif %}
{% if option.description %}
<h4>{% trans "Additional information" %}</h4>

View file

@ -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,