Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
6da592f7
Commit
6da592f7
authored
Nov 05, 2012
by
Christos Stavrakakis
Browse files
Delete BackendNetworks when deleting a Backend
parent
737f41d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-cyclades-app/synnefo/db/models.py
View file @
6da592f7
...
...
@@ -157,6 +157,11 @@ class Backend(models.Model):
else
:
# ON_DELETE = SET NULL
self
.
virtual_machines
.
all
().
backend
=
None
# Remove BackendNetworks of this Backend.
# Do not use networks.all().delete(), since delete() method of
# BackendNetwork will not be called!
for
net
in
self
.
networks
.
all
():
net
.
delete
()
super
(
Backend
,
self
).
delete
(
*
args
,
**
kwargs
)
def
__init__
(
self
,
*
args
,
**
kwargs
):
...
...
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