From 484cbd7731c66d1f1fb1fc01c59db5acb604ceab Mon Sep 17 00:00:00 2001 From: Cory Francis Myers Date: Tue, 13 Jul 2021 16:18:55 -0700 Subject: [PATCH] second pass through /login: validate/audit --- securedrop/source_templates/login.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/securedrop/source_templates/login.html b/securedrop/source_templates/login.html index b12771b84b0..78f96469444 100644 --- a/securedrop/source_templates/login.html +++ b/securedrop/source_templates/login.html @@ -9,7 +9,11 @@

{{ gettext('Enter Codename') }}

- {{ form.codename(id='login-with-existing-codename', class='codename-box', autocomplete='off', placeholder=gettext('Enter your codename'), autofocus=True, **{'aria-label': gettext('Enter your codename'), 'aria-required': 'true', 'aria-describedby': 'flashed login-with-existing-code-name-errors', 'aria-invalid': 'true' if form.codename.errors else 'false'}) }} + {% set aria_attributes = {'aria-label': gettext('Enter your codename'), 'aria-required': 'true'} %} + {% if form.codename.errors %} + {% set _dummy = aria_attributes.update({'aria-describedby': 'flashed login-with-existing-code-name-errors', 'aria-invalid': 'true'}) %} + {% endif %} + {{ form.codename(id='login-with-existing-codename', class='codename-box', autocomplete='off', placeholder=gettext('Enter your codename'), autofocus=True, **aria_attributes) }} {% if form.codename.errors %}