-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
just using field.errors to check if there are errors is enough
- Loading branch information
Showing
1 changed file
with
6 additions
and
8 deletions.
There are no files selected for viewing
14 changes: 6 additions & 8 deletions
14
python/nav/web/templates/custom_crispy_templates/form_checkbox.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
<div id="div_{{ field.auto_id }}" class="ctrlHolder{% if field.errors and form_show_errors %} error{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}"> | ||
<div id="div_{{ field.auto_id }}" class="ctrlHolder{% if field.errors %} error{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}"> | ||
<label for="{{ field.id_for_label }}"> | ||
{{ field.label}}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %} | ||
{{ field }} | ||
</label> | ||
{% if form_show_errors %} | ||
{% for error in field.errors %} | ||
<small id="error_{{ forloop.counter }}_{{ field.auto_id }}" class="errorField"> | ||
{{ error }} | ||
</small> | ||
{% endfor %} | ||
{% endif %} | ||
{% for error in field.errors %} | ||
<small id="error_{{ forloop.counter }}_{{ field.auto_id }}" class="errorField"> | ||
{{ error }} | ||
</small> | ||
{% endfor %} | ||
</div> |