Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

newforms: Simplified BoundField._errors()

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4172 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 558e07a9bc8b234a3392948a9d95798bd8a156e6 1 parent 9a02d66
@adrianholovaty adrianholovaty authored
Showing with 1 addition and 4 deletions.
  1. +1 −4 django/newforms/forms.py
View
5 django/newforms/forms.py
@@ -179,10 +179,7 @@ def _errors(self):
Returns an ErrorList for this field. Returns an empty ErrorList
if there are none.
"""
- try:
- return self.form.errors[self.name]
- except KeyError:
- return ErrorList()
+ return self.form.errors.get(self.name, ErrorList())
errors = property(_errors)
def as_widget(self, widget, attrs=None):
Please sign in to comment.
Something went wrong with that request. Please try again.