On Tuesday, 12 September 2017 14:18:29 UTC+1, Daniel Roseman wrote:
>
> On Tuesday, 12 September 2017 08:52:37 UTC+1, Moreplavec wrote:
>>
>> <snip>
>>
>>> <form action="." method="POST">{% csrf_token %}
>>>                         {{ form.non_field_errors }}
>>>                         {% for hidden in form.hidden_fields %}
>>>                             {{ hidden }}
>>>                         {% endfor %}
>>>                         {% for field in form.visible_fields %}
>>>                         <div class="form-group">
>>>                             {% if field.field.required %}
>>>                             {{ field.errors }}
>>>                                 {{ field.label }}<span 
>>> class="special_class">*</span>{{ field }}
>>>                             {% else  %}
>>>                                 {{ field.label }} {{ field }}
>>>                             {% endif %}
>>>                         </div>
>>>                         {% endfor %}
>>
>>
> <snip>
>>>
>>
> For some reason, you only show `{{ form.errors }}` if the field is 
> required; and your email is not (becase you have blank=True in the model 
> for that field). 
>
> Move the form.errors element out of that if block.
> --
> DR.
>

Sorry, that should have been `{{ field.errors }}`. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f68d81d4-8740-4698-bfcb-345b996d8c6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to