Skip to content

Commit ac5e88b

Browse files
committed
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 ietf-tools#3081.
- Legacy-Id: 18501
1 parent 585271a commit ac5e88b

10 files changed

Lines changed: 15 additions & 9 deletions

File tree

ietf/context_processors.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,7 @@ def sql_debug(request):
4242
else:
4343
return {'sql_debug': False }
4444

45+
def settings_info(request):
46+
return {
47+
'settings': settings,
48+
}

ietf/ietfauth/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,8 @@ def change_password(request):
596596
# keep the session
597597
update_session_auth_hash(request, user)
598598

599-
send_mail(request, emails, None, "Datatracker password change notification", "registration/password_change_email.txt", {})
599+
send_mail(request, emails, None, "Datatracker password change notification",
600+
"registration/password_change_email.txt", {'action_email': settings.SECRETARIAT_ACTION_EMAIL, })
600601

601602
messages.success(request, "Your password was successfully changed")
602603
return HttpResponseRedirect(urlreverse('ietf.ietfauth.views.profile'))

ietf/secr/sreq/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ def main(request):
637637

638638
# warn if there are no associated groups
639639
if not scheduled_groups and not unscheduled_groups:
640-
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)
640+
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))
641641

642642
# add session status messages for use in template
643643
for group in scheduled_groups:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<li><a href="https://www.ietf.org/instructions/meeting_materials_tool.html" target="_blank">Instructions</a>.</li>
2-
<li>If you require assistance in using this tool, or wish to report a bug, then please send a message to <a href="mailto:ietf-action@ietf.org">ietf-action@ietf.org</a>.</li>
2+
<li>If you require assistance in using this tool, or wish to report a bug, then please send a message to <a href="mailto:{{settings.SECRETARIAT_ACTION_EMAIL}}">ietf-action@ietf.org</a>.</li>
33
<li>To submit your materials via email, please send agendas to <a href="mailto:agenda@ietf.org">agenda@ietf.org</a> and minutes/presentation slides to <a href="mailto:proceedings@ietf.org">proceedings@ietf.org</a>.</li>
44
<li><bold>Note:</bold> Normal session materials materials management is now performed using the {% if meeting.number %}<a href="{% url 'ietf.meeting.views.materials' num=meeting.number %}">{% endif %}materials page{% if meeting.number %}</a>{% endif %}
55

ietf/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ def skip_unreadable_post(record):
370370
'ietf.context_processors.server_mode',
371371
'ietf.context_processors.debug_mark_queries_from_view',
372372
'ietf.context_processors.revision_info',
373+
'ietf.context_processors.settings_info',
373374
'ietf.secr.context_processors.secr_revision_info',
374375
'ietf.context_processors.rfcdiff_base_url',
375376
],
@@ -742,7 +743,8 @@ def skip_unreadable_post(record):
742743
IANA_EVAL_EMAIL = "drafts-eval@icann.org"
743744
SESSION_REQUEST_FROM_EMAIL = 'IETF Meeting Session Request Tool <session-request@ietf.org>'
744745

745-
SECRETARIAT_TICKET_EMAIL = "ietf-action@ietf.org"
746+
SECRETARIAT_ACTION_EMAIL = "ietf-action@ietf.org"
747+
SECRETARIAT_INFO_EMAIL = "ietf-info@ietf.org"
746748

747749
# Put real password in settings_local.py
748750
IANA_SYNC_PASSWORD = "secret"

ietf/stats/views.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,6 @@ def known_countries_list(request, stats_type=None, acronym=None):
755755

756756
return render(request, "stats/known_countries_list.html", {
757757
"countries": countries,
758-
"ticket_email_address": settings.SECRETARIAT_TICKET_EMAIL,
759758
})
760759

761760
def meeting_stats(request, num=None, stats_type=None):

ietf/templates/help/personal-information.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ <h1>Personal Information in the Datatracker</h1>
8585
<a href="/accounts/profile/">Account Info</a> page by the individual
8686
after logging in to the account. If the datatracker holds such
8787
information about a person, and they don't have an account, a request to
88-
the <a href="mailto:ietf-action@ietf.org">IETF secretariat</a> to change
88+
the <a href="mailto:{{settings.SECRETARIAT_ACTION_EMAIL}}">IETF secretariat</a> to change
8989
or remove the information will be honoured to the extent feasible and
9090
legally permitted.
9191

ietf/templates/registration/edit_profile.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ <h1>Profile for {{ user.username }}</h1>
3030
dagger symbol &dagger; next to it, or listed on your
3131
<a href="{% url 'ietf.community.views.view_list' user.username %}">notification subscription page</a>. Most of this
3232
information can be edited or removed on these page. There are some exceptions, such
33-
as photos, which currently require an email to <a href="mailto:{{settings.SECRETARIAT_TICKET_EMAIL}}">the Secretariat</a>
33+
as photos, which currently require an email to <a href="mailto:{{settings.SECRETARIAT_INFO_EMAIL}}">the Secretariat</a>
3434
if you wish to update or remove the information.
3535

3636
</p>

ietf/templates/registration/missing_person.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ <h1>Missing person info</h1>
88

99
<p>
1010
There is no person record associated with your login. Please
11-
contact the secretariat at <a href="mailto:ietf-action@ietf.org">ietf-action@ietf.org</a>
11+
contact the secretariat at <a href="mailto:{{settings.SECRETARIAT_INFO_EMAIL}}">{{settings.SECRETARIAT_INFO_EMAIL}}</a>
1212
and explain the situation.
1313
</p>
1414
{% endblock %}

ietf/templates/stats/known_countries_list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<h1>{% block title %}Countries known to the Datatracker{% endblock %}</h1>
1111

12-
<p>In case you think a country or an alias is missing from the list, you can <a href="mailto:{{ ticket_email_address }}">file a ticket</a>.</p>
12+
<p>In case you think a country or an alias is missing from the list, you can <a href="mailto:{{ settings.SECRETARIAT_ACTION_EMAIL }}">file a ticket</a>.</p>
1313

1414
{% if request.user.is_staff %}
1515
<p>Note: since you're an admin, the country names are linked to their corresponding admin page.</p>

0 commit comments

Comments
 (0)