diff options
Diffstat (limited to 'python_moonutilities')
4 files changed, 17 insertions, 9 deletions
diff --git a/python_moonutilities/Changelog b/python_moonutilities/Changelog index 61225b2b..ae7f352f 100644 --- a/python_moonutilities/Changelog +++ b/python_moonutilities/Changelog @@ -94,3 +94,7 @@ CHANGES 1.4.9 ----- - Add some exceptions when deletion of elements is impossible + +1.4.10 +----- +- Add CategoryNameInvalid and PerimeterNameInvalid exceptions diff --git a/python_moonutilities/python_moonutilities/__init__.py b/python_moonutilities/python_moonutilities/__init__.py index d313ecc3..6b30dedc 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.9" +__version__ = "1.4.10" diff --git a/python_moonutilities/python_moonutilities/exceptions.py b/python_moonutilities/python_moonutilities/exceptions.py index bb2d35b7..a43ac89f 100644 --- a/python_moonutilities/python_moonutilities/exceptions.py +++ b/python_moonutilities/python_moonutilities/exceptions.py @@ -197,6 +197,11 @@ class AdminRule(AdminException): code = 400 title = 'Rule Exception' +class CategoryNameInvalid(AdminMetaData): + description = _("The given category name is invalid.") + code = 409 + title = 'Category Name Invalid' + logger = "ERROR" class SubjectCategoryNameExisting(AdminMetaData): description = _("The given subject category name already exists.") @@ -261,6 +266,12 @@ class ActionCategoryUnknown(AdminMetaData): logger = "ERROR" +class PerimeterNameInvalid(AdminPerimeter): + description = _("The given name is not valid.") + code = 400 + title = 'Perimeter Name is Invalid' + logger = "ERROR" + class SubjectUnknown(AdminPerimeter): description = _("The given subject is unknown.") code = 400 @@ -674,13 +685,6 @@ class DeleteCategoryWithMetaRule(MoonError): 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 diff --git a/python_moonutilities/python_moonutilities/security_functions.py b/python_moonutilities/python_moonutilities/security_functions.py index 84e9ab7d..5d5275ee 100644 --- a/python_moonutilities/python_moonutilities/security_functions.py +++ b/python_moonutilities/python_moonutilities/security_functions.py @@ -120,7 +120,7 @@ def validate_data(data): raise ValueError('Value is Not String or Container or Dictionary') -def validate_input(type, args_state=[], kwargs_state=[], body_state=[]): +def validate_input(type='get', args_state=[], kwargs_state=[], body_state=[]): """ this fucntion works only on List or tuple or dictionary of Strings ,and String direct Check if input of function is Valid or not, Valid if not has spaces and values is not None or empty. |