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)