Объект 'bool' не имеет атрибута 'id', как я могу исправить эту ошибку в моем проекте django [закрыто]
@api_view(['POST'])
@permission_classes((permissions.AllowAny,))
def login(req):
email = req.data.get('email')
username = req.data.get('username')
password = req.data.get('password')
user = TokenObtainPairSerializer(
data=req.data).is_valid(raise_exception=True)
if user is not None:
try:
token = RefreshToken.for_user(user)
print(token, "Token")
except Exception as e:
return Response({'message': "Login Failed " + str(e)})
else:
pass
return Response({'message': "Login Successful"})
Я пытался сделать пользовательскую простую jwt аутентификацию с помощью rest_framework_simplejwt, но получил ошибку "'bool' object has no attribute 'id', can anyone explain me why this happensning.