add company code to organization serialzier
This commit is contained in:
@@ -141,6 +141,11 @@ class UserViewSet(ModelViewSet):
|
||||
else:
|
||||
return Response(serializer.errors, status=status.HTTP_403_FORBIDDEN)
|
||||
|
||||
def destroy(self, request, *args, **kwargs):
|
||||
instance = self.get_object()
|
||||
self.perform_destroy(instance)
|
||||
return Response(status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
@action(
|
||||
methods=['get'],
|
||||
detail=False,
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -191,7 +191,8 @@ class OrganizationSerializer(serializers.ModelSerializer):
|
||||
'province',
|
||||
'city',
|
||||
'parent_organization',
|
||||
'national_unique_id'
|
||||
'national_unique_id',
|
||||
'company_code'
|
||||
]
|
||||
extra_kwargs = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user