Code works on previous version of Django 1.8.4
Django 1.9 displays error in template
Model:
{{{
class Foo(models.Model):
email = models.EmailAddress(unique = True)
}}}
View:
{{{
from django.views.generic import CreateView
Class BarCreateView(CreateView):
def form_invalid(self, form):
if form.has_error('email', 'unique'):
form.errors.pop('email', None)
return super(BarCreateView, self).form_invalid(form)
}}}
Template:
{{{
<form id="login_form" method="post" action="">
{% csrf_token %}
{{form}}
<input type="submit" value="Submit" />
</form>
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25973>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => duplicate
* needs_tests: => 0
* needs_docs: => 0
Comment:
I believe this is a duplicate of #25548, which will be fixed in the
upcoming 1.9.1 release. Please could you test with the latest 1.9.X
branch?
--
Ticket URL: <https://code.djangoproject.com/ticket/25973#comment:1>