Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nounous
re2o
Commits
52dce2d3
Commit
52dce2d3
authored
Nov 19, 2016
by
lhark
Browse files
Fix port creation
parent
02194340
Changes
1
Hide whitespace changes
Inline
Side-by-side
topologie/models.py
View file @
52dce2d3
...
...
@@ -40,8 +40,9 @@ class Port(models.Model):
unique_together
=
(
'switch'
,
'port'
)
def
clean
(
self
):
if
self
.
port
>
self
.
switch
.
number
:
raise
ValidationError
(
"Ce port ne peut exister, numero trop élevé"
)
if
hasattr
(
self
,
'switch'
):
if
self
.
port
>
self
.
switch
.
number
:
raise
ValidationError
(
"Ce port ne peut exister, numero trop élevé"
)
if
self
.
room
and
self
.
machine_interface
or
self
.
room
and
self
.
related
or
self
.
machine_interface
and
self
.
related
:
raise
ValidationError
(
"Chambre, interface et related_port sont mutuellement exclusifs"
)
if
self
.
related
==
self
:
...
...
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