Skip to content

Commit e69cb6a

Browse files
author
Sebastian Brandt
committed
Set MacAddressFormField widget's maxlength since it is no longer pulled from model validator.
1 parent 62cae13 commit e69cb6a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

netfields/forms.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,8 @@ def to_python(self, value):
8484
return EUI(value, dialect=mac_unix_common)
8585
except (AddrFormatError, TypeError):
8686
raise ValidationError(self.error_messages['invalid'])
87+
88+
def widget_attrs(self, widget):
89+
attrs = super(MACAddressFormField, self).widget_attrs(widget)
90+
attrs.update({'maxlength': '17'})
91+
return attrs

0 commit comments

Comments
 (0)