summaryrefslogtreecommitdiff
path: root/django/newforms/forms.py
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-11-27 05:02:21 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-11-27 05:02:21 +0000
commit7c1cc5fb25929f2bdbce2c2a7c55cdb4374680c0 (patch)
treeb0735d4ebb2b822a1a045c1d9f29ee2a367698c5 /django/newforms/forms.py
parent190c987e631efeebfab5892aef9a980963cfab7e (diff)
newforms: Small short-circuit optimization to BoundField.as_widget()
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4121 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/newforms/forms.py')
-rw-r--r--django/newforms/forms.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/newforms/forms.py b/django/newforms/forms.py
index e381bb906e..ae836ba779 100644
--- a/django/newforms/forms.py
+++ b/django/newforms/forms.py
@@ -176,7 +176,7 @@ class BoundField(object):
def as_widget(self, widget, attrs=None):
attrs = attrs or {}
auto_id = self.auto_id
- if not attrs.has_key('id') and not widget.attrs.has_key('id') and auto_id:
+ if auto_id and not attrs.has_key('id') and not widget.attrs.has_key('id'):
attrs['id'] = auto_id
return widget.render(self._name, self._form.data.get(self._name, None), attrs=attrs)