do not clean ip from vlan if it is no assigned
This commit is contained in:
parent
6f3530095f
commit
40c20abddc
1 changed files with 5 additions and 3 deletions
|
@ -184,9 +184,11 @@ def remove(unit_id=0):
|
||||||
try:
|
try:
|
||||||
#pubvlans depends on deploy as foreign key so delete them first
|
#pubvlans depends on deploy as foreign key so delete them first
|
||||||
for pubvlan in deploy.inv_pubvlans:
|
for pubvlan in deploy.inv_pubvlans:
|
||||||
pubvlan.pubaddr.pubvlan_id = None
|
#clean public addr assignment
|
||||||
pubvlan.pubaddr.user_id = None
|
if pubvlan.pubaddr != None:
|
||||||
db.session.commit()
|
pubvlan.pubaddr.pubvlan_id = None
|
||||||
|
pubvlan.pubaddr.user_id = None
|
||||||
|
db.session.commit()
|
||||||
db.session.delete(pubvlan)
|
db.session.delete(pubvlan)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue