admin users can not be deleted

This commit is contained in:
2025-10-27 15:53:47 +03:30
parent caf11802f7
commit 0af53bddb8
3 changed files with 27 additions and 1 deletions

View File

@@ -25,3 +25,10 @@ class UserExistException(APIException):
status_code = status.HTTP_403_FORBIDDEN
default_detail = _('کاربری با این شماره موبایل یا با این نام کاربری از قبل وجود دارد') # noqa
default_code = 'user_does_not_exist'
class AdminDeleteException(APIException):
""" admin user can not be deleted """
status_code = status.HTTP_403_FORBIDDEN
default_detail = _('این کاربر ادمین است و قابلیت حذف ندارد') # noqa
default_code = 'user_does_not_exist'