mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Email logins.
This commit is contained in:
parent
788df86af9
commit
8d482077ad
1 changed files with 2 additions and 1 deletions
|
@ -3,6 +3,7 @@ from django import forms
|
|||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth import authenticate
|
||||
from django.db.models import Q
|
||||
from apps.reader.models import Feature
|
||||
from utils import log as logging
|
||||
|
||||
|
@ -21,7 +22,7 @@ class LoginForm(forms.Form):
|
|||
username = self.cleaned_data.get('username').lower()
|
||||
password = self.cleaned_data.get('password', '')
|
||||
|
||||
user = User.objects.filter(username__iexact=username)
|
||||
user = User.objects.filter(Q(username__iexact=username) | Q(email=username))
|
||||
if username and user:
|
||||
self.user_cache = authenticate(username=user[0].username, password=password)
|
||||
if self.user_cache is None:
|
||||
|
|
Loading…
Add table
Reference in a new issue