Commits

Vladimir Korsun committed 60867f7

Required attribute is not required now.

Comments (0)

Files changed (2)

 
 setup(
     name='django-field-attributes',
-    version='1.2.2',
+    version='1.2.3',
     packages=['django-field-attributes',
               'django-field-attributes.templatetags'],
     url='http://bitbucket.org/amigo/django-field-attributes',

src/templatetags/field_attributes.py

     Substitute field widget attributes
     """
 
-    if kwargs.pop('required') in [True, 'True', 'required']:
+    required = kwargs.get('required')
+
+    if required in [True, 'True', 'required']:
         kwargs['required'] = 'required'
 
     field.field.widget.attrs.update(kwargs)