From 019057ddab0d1ade47e9194578af67775120944e Mon Sep 17 00:00:00 2001 From: Andrey Date: Fri, 8 Dec 2017 17:44:49 +0300 Subject: [PATCH] fix --- access/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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'))