diff --git a/access/views.py b/access/views.py index 0118dd2..db4fbdc 100644 --- a/access/views.py +++ b/access/views.py @@ -110,7 +110,7 @@ class RegistrationView(APIView): @staticmethod def post(request): try: - get_user_model().objects.get(email=request.JSON['email'].lower()) + user = get_user_model().objects.get(email=request.JSON['email'].lower()) return Response('user already exist', status=403) except get_user_model().DoesNotExist: password = request.JSON.get('password') @@ -145,7 +145,7 @@ class LoginView(APIView): @staticmethod def post(request): password = request.JSON.get('password') - email = request.JSON.get('email') + email = request.JSON.get('email').lower() if not request.user.is_authenticated(): if not password == "skillbox": user = auth.authenticate(email=email, password=request.JSON.get('password'))