Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
re2o
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nounous
re2o
Commits
6dbfbb89
Commit
6dbfbb89
authored
Sep 19, 2017
by
Maël Kervella
Committed by
Pierre Cadart
Sep 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dégage filtre de mac valide inutile et incomplet
parent
b53c5024
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
6 deletions
+0
-6
machines/forms.py
machines/forms.py
+0
-6
No files found.
machines/forms.py
View file @
6dbfbb89
...
@@ -60,12 +60,6 @@ class EditInterfaceForm(ModelForm):
...
@@ -60,12 +60,6 @@ class EditInterfaceForm(ModelForm):
if
"machine"
in
self
.
fields
:
if
"machine"
in
self
.
fields
:
self
.
fields
[
'machine'
].
queryset
=
Machine
.
objects
.
all
().
select_related
(
'user'
)
self
.
fields
[
'machine'
].
queryset
=
Machine
.
objects
.
all
().
select_related
(
'user'
)
def
clean
(
self
):
data
=
super
(
EditInterfaceForm
,
self
).
clean
()
mac
=
str
(
self
.
data
[
'mac_address'
])
if
len
(
''
.
join
(
mac
.
replace
(
"-"
,
":"
).
split
(
":"
)))
!=
12
:
self
.
add_error
(
'mac_address'
,
"Format de la mac incorrect"
)
class
AddInterfaceForm
(
EditInterfaceForm
):
class
AddInterfaceForm
(
EditInterfaceForm
):
class
Meta
(
EditInterfaceForm
.
Meta
):
class
Meta
(
EditInterfaceForm
.
Meta
):
fields
=
[
'ipv4'
,
'mac_address'
,
'type'
,
'details'
]
fields
=
[
'ipv4'
,
'mac_address'
,
'type'
,
'details'
]
...
...
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