add totp form autofocus attr

This commit is contained in:
Trent Palmer 2021-03-28 14:08:01 -07:00
parent 1bb7176643
commit 03afc74c1e

View File

@ -8,6 +8,10 @@ class EnableTotpForm(forms.ModelForm):
totp_code = forms.CharField(max_length=6)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['totp_code'].widget.attrs.update({'autofocus': 'autofocus'})
class Meta:
model = Account
fields = ("totp_code", )