Commit a077b19091947f6028b01b470b074eae2395a477

Authored by Andrew Buss
1 parent dfb508c311
Exists in master

I MIGHT HAVE ACCIDENTALLY INTRODUCED A BUG HERE

Showing 1 changed file with 1 additions and 2 deletions Side-by-side Diff

flashcards/api.py View file @ a077b19
... ... @@ -43,7 +43,6 @@
43 43 raise ValidationError('Email is required')
44 44 if 'password' not in request.data:
45 45 raise ValidationError('Password is required')
46   -
47 46 email = request.data['email']
48 47 existing_users = User.objects.filter(email=email)
49 48 if existing_users.exists():
... ... @@ -85,7 +84,7 @@
85 84 password = request.data['password']
86 85 user = authenticate(email=email, password=password)
87 86  
88   - if user is None:
  87 + if user is not None:
89 88 raise ValidationError('Invalid email or password')
90 89 if not user.is_active:
91 90 raise ValidationError('Account is disabled')