newforms: Simplified BoundField._errors()

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4172 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-12-07 05:19:01 +00:00
parent 9a02d668c1
commit 558e07a9bc
1 changed files with 1 additions and 4 deletions

View File

@ -179,10 +179,7 @@ class BoundField(StrAndUnicode):
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):