aboutsummaryrefslogtreecommitdiffstats
path: root/python_moonutilities
diff options
context:
space:
mode:
authorfrancois.cellier <francois.cellier@orange.com>2018-03-16 15:51:01 +0100
committerThomas Duval <thomas.duval@orange.com>2018-03-22 17:22:31 +0100
commit9ac76616f62ef73f093ce63017782dda6bd3fc9d (patch)
tree57cf872e020268ec78f048ab53b0cf83da8bbb69 /python_moonutilities
parent6d2dbd0af7da445b39bbb7e16a36260268c685cd (diff)
Add unique constraints on db tables
Change-Id: I8480ed2be16f73ada314f64f0bfda8e788288933
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.py41
3 files changed, 47 insertions, 2 deletions
diff --git a/python_moonutilities/Changelog b/python_moonutilities/Changelog
index 4c08f10c..e6ab2f6e 100644
--- a/python_moonutilities/Changelog
+++ b/python_moonutilities/Changelog
@@ -85,4 +85,8 @@ CHANGES
1.4.7
-----
-- Delete the auth.py file to remove some code duplication \ No newline at end of file
+- Delete the auth.py file to remove some code duplication
+
+1.4.8
+-----
+- Add SubjectScopeExisting, ObjectScopeExisting, ActionScopeExisting exceptions \ No newline at end of file
diff --git a/python_moonutilities/python_moonutilities/__init__.py b/python_moonutilities/python_moonutilities/__init__.py
index 43f8645f..cabb4c52 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.7"
+__version__ = "1.4.8"
diff --git a/python_moonutilities/python_moonutilities/exceptions.py b/python_moonutilities/python_moonutilities/exceptions.py
index f3763428..f1dcd31e 100644
--- a/python_moonutilities/python_moonutilities/exceptions.py
+++ b/python_moonutilities/python_moonutilities/exceptions.py
@@ -282,6 +282,26 @@ class ActionUnknown(AdminPerimeter):
logger = "ERROR"
+class SubjectExisting(AdminPerimeter):
+ description = _("The given subject is existing.")
+ code = 409
+ title = 'Subject Existing'
+ logger = "ERROR"
+
+
+class ObjectExisting(AdminPerimeter):
+ description = _("The given object is existing.")
+ code = 409
+ title = 'Object Existing'
+ logger = "ERROR"
+
+
+class ActionExisting(AdminPerimeter):
+ description = _("The given action is existing.")
+ code = 409
+ title = 'Action Existing'
+ logger = "ERROR"
+
class SubjectNameExisting(AdminPerimeter):
description = _("The given subject name is existing.")
code = 400
@@ -338,6 +358,27 @@ class ActionScopeUnknown(AdminScope):
logger = "ERROR"
+class SubjectScopeExisting(AdminScope):
+ description = _("The given subject scope is existing.")
+ code = 409
+ title = 'Subject Scope Existing'
+ logger = "ERROR"
+
+
+class ObjectScopeExisting(AdminScope):
+ description = _("The given object scope is existing.")
+ code = 409
+ title = 'Object Scope Existing'
+ logger = "ERROR"
+
+
+class ActionScopeExisting(AdminScope):
+ description = _("The given action scope is existing.")
+ code = 409
+ title = 'Action Scope Existing'
+ logger = "ERROR"
+
+
class SubjectScopeNameExisting(AdminScope):
description = _("The given subject scope name is existing.")
code = 400