Skip to content

Commit

Permalink
Merge pull request #6370 from freedomofpress/backport-6368
Browse files Browse the repository at this point in the history
[2.3.0] Backport fixes to min-length message gettext formatting.
  • Loading branch information
zenmonkeykstop authored Mar 29, 2022
2 parents 4c07df0 + d2a5962 commit d5ec053
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion securedrop/source_app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def submit(logged_in_source: SourceUser) -> werkzeug.Response:
min_len = InstanceConfig.get_default().initial_message_min_len
if (min_len > 0) and (msg and not fh) and (len(msg) < min_len):
flash(gettext(
"Your first message must be at least {} characters long.".format(min_len)),
"Your first message must be at least {} characters long.").format(min_len),
"error")
return redirect(url_for('main.lookup'))

Expand Down
4 changes: 2 additions & 2 deletions securedrop/source_templates/lookup.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ <h2 id="submit-heading" class="headline">{{ gettext('Submit Messages') }}</h2>
{{ form.msg(class="fill-parent") }}
{% if allow_document_uploads %}
{% if min_len > 0 %}
<p class="center" id="min-msg-length">{{ gettext('If you are only sending a message, it must be at least {} characters long.'.format(min_len)) }}</p>
<p class="center" id="min-msg-length">{{ gettext('If you are only sending a message, it must be at least {} characters long.').format(min_len) }}</p>
{% endif %}
{% else %}
{% if min_len > 0 %}
<p class="center" id="min-msg-length">{{ gettext('Your first message must be at least {} characters long.'.format(min_len)) }}</p>
<p class="center" id="min-msg-length">{{ gettext('Your first message must be at least {} characters long.').format(min_len) }}</p>
{% endif %}
{% endif %}
</div>
Expand Down

0 comments on commit d5ec053

Please sign in to comment.