Фикс авторизации

main
through-your-tears 9 months ago
parent a2e6175ee4
commit 5c8b1292e9

@ -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(

@ -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)

Loading…
Cancel
Save