20 lines
778 B
Python
20 lines
778 B
Python
from rest_framework.exceptions import APIException
|
|
from django.utils.translation import gettext_lazy as _
|
|
from rest_framework import status
|
|
|
|
|
|
class TokenBlackListedException(APIException):
|
|
""" exception for blocked access tokens """
|
|
|
|
status_code = status.HTTP_401_UNAUTHORIZED
|
|
default_detail = _('unauthorized')
|
|
default_code = 'unauthorized'
|
|
|
|
|
|
class OrganizationBankAccountException(APIException):
|
|
""" if organization does not have bank account """
|
|
|
|
status_code = status.HTTP_403_FORBIDDEN
|
|
default_detail = "برای این سازمان حساب بانکی تعریف نشده است, ابتدا حساب بانکی تعریف کنید" # noqa
|
|
default_code = "برای این سازمان حساب بانکی تعریف نشده است" # noqa
|