Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
77d7975a
authored
Oct 18, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall: fix pickle error
parent
c0b4ef92
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
circle/firewall/fields.py
+5
-4
No files found.
circle/firewall/fields.py
View file @
77d7975a
...
@@ -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
=
'
%.2
X'
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
=
'
%.2
X'
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'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment