settings: avatar & username (& little stuff too)

This commit is contained in:
AdrienLSH
2024-03-11 15:21:47 +01:00
parent 4b3be86b2e
commit 4238b3d2be
19 changed files with 302 additions and 214 deletions

View File

@ -2,15 +2,13 @@ from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import permissions, status
from django.http import HttpRequest
from django.contrib.auth import login
from rest_framework.authentication import SessionAuthentication
from ..serializers.login import LoginSerializer
class LoggedView(APIView):
permission_classes = (permissions.AllowAny,)
authentication_classes = (SessionAuthentication,)
def get(self, request: HttpRequest):
return Response(status = (status.HTTP_200_OK if request.user.is_authenticated else status.HTTP_400_BAD_REQUEST))
return Response(status=status.HTTP_200_OK if request.user.is_authenticated else status.HTTP_400_BAD_REQUEST)