aboutsummaryrefslogtreecommitdiffstats
path: root/python_moonutilities
diff options
context:
space:
mode:
authorReemMahmoud <rfawzy.ext@orange.com>2018-04-12 14:39:39 +0200
committerThomas Duval <thomas.duval@orange.com>2018-04-18 10:52:41 +0200
commite93c1de651a76f06ef0a3f247db4be5a40860139 (patch)
tree06006954880e94947aaa7611b4490ce811d040ba /python_moonutilities
parent85209d217c85ada8a55487f5c77fb2990ad0c209 (diff)
Check data before category
Change-Id: I7e523a08fcfd3f9ea322a399c71637f268cbb38e Signed-off-by: ReemMahmoud <rfawzy.ext@orange.com>
Diffstat (limited to 'python_moonutilities')
-rw-r--r--python_moonutilities/Changelog6
-rw-r--r--python_moonutilities/python_moonutilities/__init__.py2
-rw-r--r--python_moonutilities/python_moonutilities/exceptions.py49
3 files changed, 55 insertions, 2 deletions
diff --git a/python_moonutilities/Changelog b/python_moonutilities/Changelog
index e6ab2f6e..61225b2b 100644
--- a/python_moonutilities/Changelog
+++ b/python_moonutilities/Changelog
@@ -89,4 +89,8 @@ CHANGES
1.4.8
-----
-- Add SubjectScopeExisting, ObjectScopeExisting, ActionScopeExisting exceptions \ No newline at end of file
+- Add SubjectScopeExisting, ObjectScopeExisting, ActionScopeExisting exceptions
+
+1.4.9
+-----
+- Add some exceptions when deletion of elements is impossible
diff --git a/python_moonutilities/python_moonutilities/__init__.py b/python_moonutilities/python_moonutilities/__init__.py
index cabb4c52..d313ecc3 100644
--- a/python_moonutilities/python_moonutilities/__init__.py
+++ b/python_moonutilities/python_moonutilities/__init__.py
@@ -3,6 +3,6 @@
# license which can be found in the file 'LICENSE' in this package distribution
# or at 'http://www.apache.org/licenses/LICENSE-2.0'.
-__version__ = "1.4.8"
+__version__ = "1.4.9"
diff --git a/python_moonutilities/python_moonutilities/exceptions.py b/python_moonutilities/python_moonutilities/exceptions.py
index f1dcd31e..bb2d35b7 100644
--- a/python_moonutilities/python_moonutilities/exceptions.py
+++ b/python_moonutilities/python_moonutilities/exceptions.py
@@ -651,3 +651,52 @@ class PolicyExisting(MoonError):
code = 409
title = 'Policy Error'
logger = "Error"
+
+
+class DeleteData(MoonError):
+ description = _("Cannot delete data with assignment")
+ code = 400
+ title = 'Data Error'
+ logger = "Error"
+
+
+class DeleteCategoryWithData(MoonError):
+ description = _("Cannot delete category with data")
+ code = 400
+ title = 'Category Error'
+ logger = "Error"
+
+
+class DeleteCategoryWithMetaRule(MoonError):
+ description = _("Cannot delete category with meta rule")
+ code = 400
+ title = 'Category Error'
+ logger = "Error"
+
+
+class DeleteCategoryWithData(MoonError):
+ description = _("Cannot delete category with data")
+ code = 400
+ title = 'Category Error'
+ logger = "Error"
+
+
+class DeleteModelWithPolicy(MoonError):
+ description = _("Cannot delete model with policy")
+ code = 400
+ title = 'Model Error'
+ logger = "Error"
+
+
+class DeletePolicyWithPdp(MoonError):
+ description = _("Cannot delete policy with pdp")
+ code = 400
+ title = 'Policy Error'
+ logger = "Error"
+
+
+class DeleteMetaRuleWithModel(MoonError):
+ description = _("Cannot delete meta rule with model")
+ code = 400
+ title = 'Meta rule Error'
+ logger = "Error"