add company code to organization serialzier

This commit is contained in:
2025-06-16 08:29:17 +03:30
parent d8ca9d2256
commit 8df059bee9
7 changed files with 41 additions and 7 deletions

View File

@@ -5,6 +5,7 @@ from django.contrib.auth.models import update_last_login
from apps.authentication.models import User
from rest_framework import exceptions
from django.core.cache import cache
from rest_framework import status
from typing import Any
@@ -34,9 +35,9 @@ class CustomizedTokenObtainPairSerializer(TokenObtainPairSerializer): # noqa
data["otp_status"] = self.user.otp_status
if not self.user.is_active:
raise exceptions.AuthenticationFailed(
self.error_messages["no_active_account"],
"no_active_account",
raise exceptions.APIException(
"user is not active",
status.HTTP_403_FORBIDDEN
)
if api_settings.UPDATE_LAST_LOGIN: