add distribution delete exception

This commit is contained in:
2025-10-26 15:05:36 +03:30
parent 13b6a42bda
commit 0ce2938344
2 changed files with 11 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
from rest_framework.exceptions import APIException
from rest_framework import status
from rest_framework.exceptions import APIException
class QuotaWeightException(APIException):
@@ -18,6 +18,14 @@ class DistributionWeightException(APIException):
default_code = 'error'
class DistributionDeletedException(APIException):
""" if distribution is deleted """
status_code = status.HTTP_400_BAD_REQUEST
default_detail = "امکان حذف این توزیع وجود ندارد. ورود به انبار یا توزیعی برای آن ثبت شده است" # noqa
default_code = 'error'
class QuotaClosedException(APIException):
""" if quota is closed, operations can not be done """