diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2006-12-07 05:19:01 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2006-12-07 05:19:01 +0000 |
| commit | 558e07a9bc8b234a3392948a9d95798bd8a156e6 (patch) | |
| tree | 37ac8226a66ca2f7bd499da0f08d2f0448bcafc8 | |
| parent | 9a02d668c1066a313f973ca80b204fce9eb1a252 (diff) | |
newforms: Simplified BoundField._errors()
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4172 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/newforms/forms.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/django/newforms/forms.py b/django/newforms/forms.py index 503e17937a..29e387a51b 100644 --- a/django/newforms/forms.py +++ b/django/newforms/forms.py @@ -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): |
