Skip to content
Browse files

newforms: Small short-circuit optimization to BoundField.as_widget()

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 190c987 commit 7c1cc5fb25929f2bdbce2c2a7c55cdb4374680c0 @adrianholovaty adrianholovaty committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/newforms/
2 django/newforms/
@@ -176,7 +176,7 @@ def _errors(self):
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,, None), attrs=attrs)

0 comments on commit 7c1cc5f

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