Skip to content

Commit 155c97f

Browse files
deniszhdi
andauthored
Fixing recovery code filename for test site (#9535)
* Fixing recovery code filename for test site (fixing #9190) * Fixing translations * Simplifying logic for consistency with other templates Co-authored-by: Dustin Ingram <[email protected]>
1 parent 4946429 commit 155c97f

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

warehouse/locale/messages.pot

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ msgstr ""
911911
#: warehouse/templates/accounts/profile.html:32
912912
#: warehouse/templates/accounts/register.html:89
913913
#: warehouse/templates/manage/account.html:272
914-
#: warehouse/templates/manage/account/recovery_codes-provision.html:81
914+
#: warehouse/templates/manage/account/recovery_codes-provision.html:85
915915
#: warehouse/templates/manage/roles.html:173
916916
msgid "Username"
917917
msgstr ""
@@ -3010,7 +3010,7 @@ msgstr ""
30103010
msgid "Save role"
30113011
msgstr ""
30123012

3013-
#: warehouse/templates/manage/account/recovery_codes-provision.html:65
3013+
#: warehouse/templates/manage/account/recovery_codes-provision.html:69
30143014
#: warehouse/templates/manage/roles.html:95
30153015
msgid "Save"
30163016
msgstr ""
@@ -3309,21 +3309,21 @@ msgstr ""
33093309
msgid "Save your recovery codes"
33103310
msgstr ""
33113311

3312-
#: warehouse/templates/manage/account/recovery_codes-provision.html:64
3312+
#: warehouse/templates/manage/account/recovery_codes-provision.html:68
33133313
msgid "Download as file"
33143314
msgstr ""
33153315

3316-
#: warehouse/templates/manage/account/recovery_codes-provision.html:67
3317-
#: warehouse/templates/manage/account/recovery_codes-provision.html:69
3316+
#: warehouse/templates/manage/account/recovery_codes-provision.html:71
33183317
#: warehouse/templates/manage/account/recovery_codes-provision.html:73
3318+
#: warehouse/templates/manage/account/recovery_codes-provision.html:77
33193319
msgid "Continue"
33203320
msgstr ""
33213321

3322-
#: warehouse/templates/manage/account/recovery_codes-provision.html:76
3322+
#: warehouse/templates/manage/account/recovery_codes-provision.html:80
33233323
msgid "These codes will not be visible again."
33243324
msgstr ""
33253325

3326-
#: warehouse/templates/manage/account/recovery_codes-provision.html:79
3326+
#: warehouse/templates/manage/account/recovery_codes-provision.html:83
33273327
msgid "Ensure that you have securely stored them before continuing."
33283328
msgstr ""
33293329

warehouse/templates/manage/account/recovery_codes-provision.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ <h2>{% trans %}Save your recovery codes{% endtrans %}</h2>
6161
<button type="button" class="button button--small copy-tooltip copy-tooltip-w" data-tooltip-label="{% trans %}Copy to clipboard{% endtrans %}" data-clipboard-text="{{ 'PyPI recovery codes\n' + recovery_codes|join('\n') }}">
6262
{% trans %}Copy{% endtrans %}
6363
</button>
64-
<a href="data:text/plain;,{{ recovery_codes|join('%0A') }}" download="PyPI-Recovery-Codes.txt" class="button button--small" data-tooltip-label="{% trans %}Download as file{% endtrans %}">
64+
{% set _recovery_codes_filename = "PyPI-Recovery-Codes.txt" %}
65+
{% if testPyPI %}
66+
{% set _recovery_codes_filename = "TestPyPI-Recovery-Codes.txt" %}
67+
{% endif %}
68+
<a href="data:text/plain;,{{ recovery_codes|join('%0A') }}" download="{{ _recovery_codes_filename }}" class="button button--small" data-tooltip-label="{% trans %}Download as file{% endtrans %}">
6569
{% trans %}Save{% endtrans %}&nbsp;<span class="fa fa-download"></span>
6670
</a>
6771
{% set title = gettext("Continue") %}

0 commit comments

Comments
 (0)