add distribution delete exception
This commit is contained in:
@@ -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 """
|
||||
|
||||
|
||||
Reference in New Issue
Block a user