validate confirm password field on every change
This commit is contained in:
parent
35988f2fd9
commit
8686c0418b
|
@ -104,6 +104,7 @@ class IdentityView(BaseView):
|
|||
|
||||
self.form = IdentityForm()
|
||||
connect_signal(self.form, 'submit', self.done)
|
||||
connect_signal(self.form.confirm_password.widget, 'change', self._check_password)
|
||||
|
||||
self.ssh_import_confirmed = True
|
||||
|
||||
|
@ -114,6 +115,13 @@ class IdentityView(BaseView):
|
|||
]
|
||||
super().__init__(ListBox(body))
|
||||
|
||||
def _check_password(self, sender, new_text):
|
||||
password = self.form.password.value
|
||||
if not password.startswith(new_text):
|
||||
self.form.confirm_password.show_extra(("info_error", "Passwords do not match"))
|
||||
else:
|
||||
self.form.confirm_password.show_extra('')
|
||||
|
||||
def done(self, result):
|
||||
cpassword = self.model.encrypt_password(self.form.password.value)
|
||||
log.debug("*crypted* User input: {} {} {}".format(
|
||||
|
|
Loading…
Reference in New Issue