check rancher unique national code in serilaizer validation

This commit is contained in:
2025-08-30 10:40:02 +03:30
parent 29025235d5
commit 5b0d6ac8ee
2 changed files with 14 additions and 0 deletions

7
apps/herd/exception.py Normal file
View File

@@ -0,0 +1,7 @@
from rest_framework.exceptions import APIException
from rest_framework import status
class UniqueRancherApiException(APIException):
status_code = status.HTTP_403_FORBIDDEN
default_detail = "دامدار با این کد ملی از قبل در سیستم وجود دارد" # noqa