Fix form display details
This commit is contained in:
parent
cedcab85c4
commit
9e7330e24d
2 changed files with 5 additions and 2 deletions
|
|
@ -14,7 +14,7 @@
|
|||
{% endif %}
|
||||
{% if field.use_fieldset %}</fieldset>{% endif %}
|
||||
{% for text in field.errors %}<div class="invalid-feedback">{{ text }}</div>{% endfor %}
|
||||
{% if field.help_text %}
|
||||
{% if field.help_text and not field.is_hidden and not field.field.widget.input_type == "hidden" %}
|
||||
<small class="form-text text-muted"
|
||||
{% if field.auto_id %}id="{{ field.auto_id }}_helptext"{% endif %}>{{ field.help_text|safe }}</small>
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
from contextlib import suppress
|
||||
|
||||
from django import template
|
||||
|
||||
register = template.Library()
|
||||
|
|
@ -5,4 +7,5 @@ register = template.Library()
|
|||
|
||||
@register.filter
|
||||
def get_field(form, field_name):
|
||||
return form[field_name]
|
||||
with suppress(KeyError):
|
||||
return form[field_name]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue