From ac5e88b82b51ed898ec9723968d59a67c70daae6 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Thu, 17 Sep 2020 11:10:27 +0000 Subject: [PATCH] Added a context processor to make settings generally available in page templates. Split the SECRETARIAT_TICKET_EMAIL setting into SECRETARIAT_ACTION_EMAIL and SECRETARIAT_INFO_EMAIL, with different addresses. Updated places with hardcoded ietf-action@ietf.org addresses to use the settings value, and updated some places to use ietf-infor@ietf.org instead of the ietf-action address. Fixes issue #3081. - Legacy-Id: 18501 --- ietf/context_processors.py | 4 ++++ ietf/ietfauth/views.py | 3 ++- ietf/secr/sreq/views.py | 2 +- ietf/secr/templates/includes/upload_footer.html | 2 +- ietf/settings.py | 4 +++- ietf/stats/views.py | 1 - ietf/templates/help/personal-information.html | 2 +- ietf/templates/registration/edit_profile.html | 2 +- ietf/templates/registration/missing_person.html | 2 +- ietf/templates/stats/known_countries_list.html | 2 +- 10 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ietf/context_processors.py b/ietf/context_processors.py index 9ef83e4ef..e797d2bd8 100644 --- a/ietf/context_processors.py +++ b/ietf/context_processors.py @@ -42,3 +42,7 @@ def sql_debug(request): else: return {'sql_debug': False } +def settings_info(request): + return { + 'settings': settings, + } \ No newline at end of file diff --git a/ietf/ietfauth/views.py b/ietf/ietfauth/views.py index 234a7e200..642e91339 100644 --- a/ietf/ietfauth/views.py +++ b/ietf/ietfauth/views.py @@ -596,7 +596,8 @@ def change_password(request): # keep the session update_session_auth_hash(request, user) - send_mail(request, emails, None, "Datatracker password change notification", "registration/password_change_email.txt", {}) + send_mail(request, emails, None, "Datatracker password change notification", + "registration/password_change_email.txt", {'action_email': settings.SECRETARIAT_ACTION_EMAIL, }) messages.success(request, "Your password was successfully changed") return HttpResponseRedirect(urlreverse('ietf.ietfauth.views.profile')) diff --git a/ietf/secr/sreq/views.py b/ietf/secr/sreq/views.py index f0839f613..eb114952a 100644 --- a/ietf/secr/sreq/views.py +++ b/ietf/secr/sreq/views.py @@ -637,7 +637,7 @@ def main(request): # warn if there are no associated groups if not scheduled_groups and not unscheduled_groups: - messages.warning(request, 'The account %s is not associated with any groups. If you have multiple Datatracker accounts you may try another or report a problem to ietf-action@ietf.org' % request.user) + messages.warning(request, 'The account %s is not associated with any groups. If you have multiple Datatracker accounts you may try another or report a problem to %s' % (request.user, settings.SECRETARIAT_ACTION_EMAIL)) # add session status messages for use in template for group in scheduled_groups: diff --git a/ietf/secr/templates/includes/upload_footer.html b/ietf/secr/templates/includes/upload_footer.html index eff80b591..d54cd9608 100755 --- a/ietf/secr/templates/includes/upload_footer.html +++ b/ietf/secr/templates/includes/upload_footer.html @@ -1,5 +1,5 @@
  • Instructions.
  • -
  • If you require assistance in using this tool, or wish to report a bug, then please send a message to ietf-action@ietf.org.
  • +
  • If you require assistance in using this tool, or wish to report a bug, then please send a message to ietf-action@ietf.org.
  • To submit your materials via email, please send agendas to agenda@ietf.org and minutes/presentation slides to proceedings@ietf.org.
  • Note: Normal session materials materials management is now performed using the {% if meeting.number %}{% endif %}materials page{% if meeting.number %}{% endif %} diff --git a/ietf/settings.py b/ietf/settings.py index f2fd283d0..a214c9a1b 100644 --- a/ietf/settings.py +++ b/ietf/settings.py @@ -370,6 +370,7 @@ TEMPLATES = [ 'ietf.context_processors.server_mode', 'ietf.context_processors.debug_mark_queries_from_view', 'ietf.context_processors.revision_info', + 'ietf.context_processors.settings_info', 'ietf.secr.context_processors.secr_revision_info', 'ietf.context_processors.rfcdiff_base_url', ], @@ -742,7 +743,8 @@ AUDIO_IMPORT_EMAIL = ['ietf@meetecho.com'] IANA_EVAL_EMAIL = "drafts-eval@icann.org" SESSION_REQUEST_FROM_EMAIL = 'IETF Meeting Session Request Tool ' -SECRETARIAT_TICKET_EMAIL = "ietf-action@ietf.org" +SECRETARIAT_ACTION_EMAIL = "ietf-action@ietf.org" +SECRETARIAT_INFO_EMAIL = "ietf-info@ietf.org" # Put real password in settings_local.py IANA_SYNC_PASSWORD = "secret" diff --git a/ietf/stats/views.py b/ietf/stats/views.py index 54b1621e3..c2c4f3b71 100644 --- a/ietf/stats/views.py +++ b/ietf/stats/views.py @@ -755,7 +755,6 @@ def known_countries_list(request, stats_type=None, acronym=None): return render(request, "stats/known_countries_list.html", { "countries": countries, - "ticket_email_address": settings.SECRETARIAT_TICKET_EMAIL, }) def meeting_stats(request, num=None, stats_type=None): diff --git a/ietf/templates/help/personal-information.html b/ietf/templates/help/personal-information.html index cfe4051a8..9db812dd4 100644 --- a/ietf/templates/help/personal-information.html +++ b/ietf/templates/help/personal-information.html @@ -85,7 +85,7 @@ Account Info page by the individual after logging in to the account. If the datatracker holds such information about a person, and they don't have an account, a request to - the IETF secretariat to change + the IETF secretariat to change or remove the information will be honoured to the extent feasible and legally permitted. diff --git a/ietf/templates/registration/edit_profile.html b/ietf/templates/registration/edit_profile.html index 3dfaefd54..4e1cf688d 100644 --- a/ietf/templates/registration/edit_profile.html +++ b/ietf/templates/registration/edit_profile.html @@ -30,7 +30,7 @@ dagger symbol † next to it, or listed on your notification subscription page. Most of this information can be edited or removed on these page. There are some exceptions, such - as photos, which currently require an email to the Secretariat + as photos, which currently require an email to the Secretariat if you wish to update or remove the information.

    diff --git a/ietf/templates/registration/missing_person.html b/ietf/templates/registration/missing_person.html index 41df05d0a..65cc05c28 100644 --- a/ietf/templates/registration/missing_person.html +++ b/ietf/templates/registration/missing_person.html @@ -8,7 +8,7 @@

    There is no person record associated with your login. Please - contact the secretariat at ietf-action@ietf.org + contact the secretariat at {{settings.SECRETARIAT_INFO_EMAIL}} and explain the situation.

    {% endblock %} diff --git a/ietf/templates/stats/known_countries_list.html b/ietf/templates/stats/known_countries_list.html index fe4a93d4f..070607976 100644 --- a/ietf/templates/stats/known_countries_list.html +++ b/ietf/templates/stats/known_countries_list.html @@ -9,7 +9,7 @@

    {% block title %}Countries known to the Datatracker{% endblock %}

    -

    In case you think a country or an alias is missing from the list, you can file a ticket.

    +

    In case you think a country or an alias is missing from the list, you can file a ticket.

    {% if request.user.is_staff %}

    Note: since you're an admin, the country names are linked to their corresponding admin page.