add company code to organization serialzier
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user