From c0d4f2dfe12ab4a13f01d9a19962c554933767b9 Mon Sep 17 00:00:00 2001 From: gotlium Date: Mon, 8 Dec 2014 19:47:39 +0300 Subject: [PATCH] input type was added into internal confirmation forms --- secureauth/defaults.py | 1 + secureauth/forms.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/secureauth/defaults.py b/secureauth/defaults.py index 726257d..50ebd94 100644 --- a/secureauth/defaults.py +++ b/secureauth/defaults.py @@ -80,3 +80,4 @@ def _(message): ]) AUTH_USER_MODEL = get_settings('AUTH_USER_MODEL', 'auth.User') +INPUT_TYPE = get_settings('AUTH_INPUT_TYPE', 'password') diff --git a/secureauth/forms.py b/secureauth/forms.py index 8c358a0..83db9ef 100644 --- a/secureauth/forms.py +++ b/secureauth/forms.py @@ -8,7 +8,7 @@ from models import ( UserAuthNotification, UserAuthLogging, UserAuthToken, UserAuthAttempt, UserAuthCode, UserAuthPhone, UserAuthQuestion, UserAuthIP, UserAuthIPRange) -from defaults import CHECK_PASSWORD +from defaults import CHECK_PASSWORD, INPUT_TYPE from utils.sign import Sign from utils import is_phone @@ -59,7 +59,11 @@ def save(self): class CodeForm(forms.Form): - code = forms.CharField(label=_('Code'), required=True) + code = forms.CharField( + label=_('Code'), required=True, + widget=forms.TextInput(attrs={ + 'autocomplete': 'off', 'type': INPUT_TYPE + })) def __init__(self, user, model, *args, **kwargs): self.user = user