Commit 77d7975a by Bach Dániel

firewall: fix pickle error

parent c0b4ef92
...@@ -34,6 +34,10 @@ reverse_domain_re = re.compile(r'^(%\([abcd]\)d|[a-z0-9.-])+$') ...@@ -34,6 +34,10 @@ reverse_domain_re = re.compile(r'^(%\([abcd]\)d|[a-z0-9.-])+$')
ipv6_template_re = re.compile(r'^(%\([abcd]\)[dxX]|[A-Za-z0-9:-])+$') ipv6_template_re = re.compile(r'^(%\([abcd]\)[dxX]|[A-Za-z0-9:-])+$')
class mac_custom(mac_unix):
word_fmt = '%.2X'
class MACAddressFormField(forms.Field): class MACAddressFormField(forms.Field):
default_error_messages = { default_error_messages = {
'invalid': _(u'Enter a valid MAC address. %s'), 'invalid': _(u'Enter a valid MAC address. %s'),
...@@ -51,9 +55,6 @@ class MACAddressField(models.Field): ...@@ -51,9 +55,6 @@ class MACAddressField(models.Field):
description = _('MAC Address object') description = _('MAC Address object')
__metaclass__ = models.SubfieldBase __metaclass__ = models.SubfieldBase
class mac_custom(mac_unix):
word_fmt = '%.2X'
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
kwargs['max_length'] = 17 kwargs['max_length'] = 17
super(MACAddressField, self).__init__(*args, **kwargs) super(MACAddressField, self).__init__(*args, **kwargs)
...@@ -65,7 +66,7 @@ class MACAddressField(models.Field): ...@@ -65,7 +66,7 @@ class MACAddressField(models.Field):
if isinstance(value, EUI): if isinstance(value, EUI):
return value return value
return EUI(value, dialect=MACAddressField.mac_custom) return EUI(value, dialect=mac_custom)
def get_internal_type(self): def get_internal_type(self):
return 'CharField' return 'CharField'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment