Added new setting, widget, form and auth backend to allow login via user email address
To enable:
AUTHENTICATION_BACKENDS = ('common.auth.email_auth_backend.EmailAuthBackend',)
COMMON_LOGIN_METHOD = 'email'
This commit is contained in:
@@ -83,3 +83,16 @@ class TextAreaDiv(forms.widgets.Widget):
|
||||
conditional_escape(force_unicode(value))))
|
||||
|
||||
return mark_safe(result.replace('\n', '<br>'))
|
||||
|
||||
|
||||
# From: http://www.peterbe.com/plog/emailinput-html5-django
|
||||
class EmailInput(forms.widgets.Input):
|
||||
input_type = 'email'
|
||||
|
||||
def render(self, name, value, attrs=None):
|
||||
if attrs is None:
|
||||
attrs = {}
|
||||
attrs.update(dict(autocorrect='off',
|
||||
autocapitalize='off',
|
||||
spellcheck='false'))
|
||||
return super(EmailInput, self).render(name, value, attrs=attrs)
|
||||
|
||||
Reference in New Issue
Block a user