We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47e753e commit 417ce12Copy full SHA for 417ce12
api/views.py
@@ -350,6 +350,11 @@ def post(self, request):
350
return bad_request('Body must contain `email/username` and `password`')
351
352
user = authenticate(username=username, password=password)
353
+ if user == None and User.objects.filter(email=username).count() > 1:
354
+ users = User.objects.filter(email=username, is_active=True)
355
+ if users:
356
+ # We get the first one if there are still multiple available is_active:
357
+ user = authenticate(username=users[0].username, password=password)
358
359
# Determining the client IP is not always straightforward:
360
clientIP = ''
0 commit comments