avoiding for loop in django template tag

This commit is contained in:
Kristina Yin 2023-11-27 16:25:27 -08:00
parent 81b7bac482
commit 2e1ddd91e5
No known key found for this signature in database
GPG key ID: 9BB3845BB3A21584

View file

@ -21,25 +21,22 @@
{% endif %} {% endif %}
--> -->
{% if widget.attrs.required %} {% if widget.attrs.required and field.label in [
{% for required_label in [ "What is the name of the tribe you represent?",
"What is the name of the tribe you represent?", "Organization name",
"Organization name", "Street address",
"Street address", "City",
"City", "State, territory, or military post",
"State, territory, or military post", "Zip code",
"Zip code", "First name / given name",
"First name / given name", "Last name / family name",
"Last name / family name", "Title or role in your organization",
"Title or role in your organization", "Email",
"Email", "Phone"
"Phone" ] %}
] %} <abbr class="usa-hint usa-hint--required" title="required">*</abbr>
{% if field.label == required_label %}
<abbr class="usa-hint usa-hint--required" title="required"> *</abbr>
{% endif %}
{% endfor %}
{% endif %} {% endif %}
</{{ label_tag }}> </{{ label_tag }}>