import - service area in organization & validate in org rancher link

This commit is contained in:
2025-12-22 15:28:40 +03:30
parent 5eb810893b
commit 4de246f58e
3 changed files with 34 additions and 1 deletions

View File

@@ -15,3 +15,22 @@ class DuplicateRancherException(APIException):
class HerdCapacityException(APIException):
status_code = status.HTTP_403_FORBIDDEN
default_detail = "مقدار حجم سبک و سنگین وارد شده از ظرفیت گله بیشتر میباشد" # noqa
class HerdException(APIException):
""" if quota is not available """
status_code = status.HTTP_400_BAD_REQUEST
default_detail = "خطا در اطلاعات گله" # noqa
default_code = 'error'
def __init__(self, message=None, status_code=None, code=None):
if status_code is not None:
self.status_code = status_code
detail = {
"message": message,
"status_code": status_code
}
super().__init__(detail)