from rest_framework.exceptions import APIException from rest_framework import status class QuotaWeightException(APIException): """ if quota distributions weight is more """ status_code = status.HTTP_401_UNAUTHORIZED default_detail = '' default_code = 'unauthorized'