aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorasteroide <thomas.duval@orange.com>2015-11-25 15:34:23 +0100
committerasteroide <thomas.duval@orange.com>2015-11-25 15:34:23 +0100
commitfbdd3c6adc86353861fc48a8534523f85356b0cc (patch)
tree464afb71f9e89216584464208cf494d4c763a993
parentf7cc5b52cac3361f68260aac1fecd20abfc7044b (diff)
Automatically delete assignments related to a category when user asks to delete this category.
Change-Id: Ic906572bb5938891d103b11fc49b6b392edc20ef
-rw-r--r--keystone-moon/keystone/contrib/moon/backends/sql.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/keystone-moon/keystone/contrib/moon/backends/sql.py b/keystone-moon/keystone/contrib/moon/backends/sql.py
index 9bc9ee45..06071507 100644
--- a/keystone-moon/keystone/contrib/moon/backends/sql.py
+++ b/keystone-moon/keystone/contrib/moon/backends/sql.py
@@ -437,6 +437,7 @@ class IntraExtensionConnector(IntraExtensionDriver):
query = session.query(SubjectCategory)
query = query.filter_by(intra_extension_id=intra_extension_id, id=subject_category_id)
ref = query.first()
+ self.del_subject_assignment(intra_extension_id, None, None, None)
session.delete(ref)
# Getter and Setter for object_category
@@ -475,6 +476,7 @@ class IntraExtensionConnector(IntraExtensionDriver):
query = session.query(ObjectCategory)
query = query.filter_by(intra_extension_id=intra_extension_id, id=object_category_id)
ref = query.first()
+ self.del_object_assignment(intra_extension_id, None, None, None)
session.delete(ref)
# Getter and Setter for action_category
@@ -513,6 +515,7 @@ class IntraExtensionConnector(IntraExtensionDriver):
query = session.query(ActionCategory)
query = query.filter_by(intra_extension_id=intra_extension_id, id=action_category_id)
ref = query.first()
+ self.del_action_assignment(intra_extension_id, None, None, None)
session.delete(ref)
# Perimeter