From 5c8b1292e90a8ac850285279fe65a294569a2e5a Mon Sep 17 00:00:00 2001 From: through-your-tears Date: Sun, 7 Apr 2024 12:21:41 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D0=B0=D0=B2=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=B8=D0=B7=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/serializers.py | 2 +- src/jwtauth/views.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/jwtauth/serializers.py b/src/jwtauth/serializers.py index fefccf1..c2bdd46 100644 --- a/src/jwtauth/serializers.py +++ b/src/jwtauth/serializers.py @@ -55,7 +55,7 @@ class LoginSerializer(serializers.Serializer): 'A password is required to log in' ) - user = authenticate(username=email, password=password) + user = authenticate(email=email, password=password) if user is None: raise serializers.ValidationError( diff --git a/src/jwtauth/views.py b/src/jwtauth/views.py index a1f1a7c..888dc6b 100644 --- a/src/jwtauth/views.py +++ b/src/jwtauth/views.py @@ -105,7 +105,8 @@ class RegistrationAPIView(APIView): serializer.is_valid(raise_exception=True) serializer.save() ProfileRepository.create(user=UserRepository.get(serializer.data['email'])) - QRCodeRepository.create(qr_str=encrypt(serializer.data['email']), user=UserRepository.get(serializer.data['email'])) + QRCodeRepository.create(qr_str=encrypt(serializer.data['email']), + user=UserRepository.get(serializer.data['email'])) return Response(serializer.data, status=status.HTTP_201_CREATED)