Refactor group and music game models to use UniqueConstraint; update form error handling in templates
This commit is contained in:
parent
43ec6aafc4
commit
245a2503e2
5 changed files with 84 additions and 14 deletions
|
@ -1,8 +1,4 @@
|
|||
{% if form.non_field_errors %}
|
||||
<ul class="form-errors">
|
||||
{% for error in form.non_field_errors %}<li>{{ error }}</li>{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% for error in form.non_field_errors %}<article class="message error">{{ error }}</article>{% endfor %}
|
||||
<form method="post" {% if action %}action="{% url action %}"{% endif %}>
|
||||
{% csrf_token %}
|
||||
<fieldset>
|
||||
|
@ -10,12 +6,10 @@
|
|||
<label>
|
||||
{{ field.label }}
|
||||
{{ field }}
|
||||
{% if field.errors %}
|
||||
<small id="{{ field.errors.field_id }}_error" class="form-error">{{ field.errors|join:", " }}</small>
|
||||
{% endif %}
|
||||
</label>
|
||||
{% if field.errors %}
|
||||
<ul class="form-errors">
|
||||
{% for error in field.errors %}<li>{{ error }}</li>{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</fieldset>
|
||||
<input type="submit" {% if submit %}value="{{ submit }}"{% endif %}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue