otp(minor): disable autocomplete for code input

This commit is contained in:
Langhammer, Jens 2019-10-07 16:57:54 +02:00
parent 6a4233d6fd
commit 0a6f555c23
1 changed files with 4 additions and 2 deletions

View File

@ -34,8 +34,10 @@ class OTPVerifyForm(forms.Form):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
# This is a little helper so the field is focused by default # This is a little helper so the field is focused by default
# TODO: Tell browser to not suggest any values self.fields['code'].widget.attrs.update({
self.fields['code'].widget.attrs.update({'autofocus': 'autofocus'}) 'autofocus': 'autofocus',
'autocomplete': 'off'
})
class OTPSetupForm(forms.Form): class OTPSetupForm(forms.Form):