Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Adrian Holovaty authored December 07, 2006

Showing 1 changed file with 1 addition and 4 deletions. Show diff stats Hide diff stats

  1. 5  django/newforms/forms.py
5  django/newforms/forms.py
@@ -179,10 +179,7 @@ def _errors(self):
179 179
         Returns an ErrorList for this field. Returns an empty ErrorList
180 180
         if there are none.
181 181
         """
182  
-        try:
183  
-            return self.form.errors[self.name]
184  
-        except KeyError:
185  
-            return ErrorList()
  182
+        return self.form.errors.get(self.name, ErrorList())
186 183
     errors = property(_errors)
187 184
 
188 185
     def as_widget(self, widget, attrs=None):

0 notes on commit 558e07a

Please sign in to comment.
Something went wrong with that request. Please try again.