forms: mark fields expecting a new password (#26385)
This commit is contained in:
parent
5732f219c5
commit
8e4a5ef39a
|
@ -238,6 +238,9 @@ class PasswordInput(BasePasswordInput):
|
|||
|
||||
class NewPasswordInput(PasswordInput):
|
||||
def render(self, name, value, attrs=None):
|
||||
if attrs is None:
|
||||
attrs = {}
|
||||
attrs['autocomplete'] = 'new-password'
|
||||
output = super(NewPasswordInput, self).render(name, value, attrs=attrs)
|
||||
if attrs:
|
||||
_id = attrs.get('id')
|
||||
|
@ -250,6 +253,9 @@ class CheckPasswordInput(PasswordInput):
|
|||
# this widget must be named xxx2 and the other widget xxx1, it's a
|
||||
# convention, js code expect it.
|
||||
def render(self, name, value, attrs=None):
|
||||
if attrs is None:
|
||||
attrs = {}
|
||||
attrs['autocomplete'] = 'new-password'
|
||||
output = super(CheckPasswordInput, self).render(name, value, attrs=attrs)
|
||||
if attrs:
|
||||
_id = attrs.get('id')
|
||||
|
|
Loading…
Reference in New Issue