From 2754e16b1aed72e22a9abb49eaa5906191396cc6 Mon Sep 17 00:00:00 2001 From: through-your-tears Date: Sun, 7 Apr 2024 03:24:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D1=84=D0=B8=D0=BB=D1=8C=20=D1=81=D0=BE=D0=B7=D0=B4?= =?UTF-8?q?=D0=B0=D1=91=D1=82=D1=81=D1=8F=20=D0=BF=D1=80=D0=B8=20=D1=80?= =?UTF-8?q?=D0=B5=D0=B3=D0=B8=D1=81=D1=82=D1=80=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jwtauth/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jwtauth/views.py b/src/jwtauth/views.py index 235076c..0a8f9ab 100644 --- a/src/jwtauth/views.py +++ b/src/jwtauth/views.py @@ -14,7 +14,7 @@ from rest_framework.views import APIView from core.permissions import IsAuthorOrReadOnly from .models import CustomUser, RefreshToken -from .repositories import RefreshTokenRepository, ProfileRepository +from .repositories import RefreshTokenRepository, ProfileRepository, UserRepository from .serializers import RegistrationSerializer, LoginSerializer, CustomUserSerializer, ProfileSerializer from .renderers import CustomUserJSONRenderer from .token_generators import generate_rt, generate_jwt @@ -103,6 +103,7 @@ class RegistrationAPIView(APIView): serializer = self.serializer_class(data=user) serializer.is_valid(raise_exception=True) serializer.save() + ProfileRepository.create(user=UserRepository.get(serializer.data['email'])) return Response(serializer.data, status=status.HTTP_201_CREATED)