diff --git a/frappe/core/doctype/user/user.py b/frappe/core/doctype/user/user.py index c5e73b52fe..7698a71a96 100644 --- a/frappe/core/doctype/user/user.py +++ b/frappe/core/doctype/user/user.py @@ -25,7 +25,7 @@ class User(Document): def __setup__(self): # because it is handled separately - self.flags.ignore_save_passwords = True + self.flags.ignore_save_passwords = ['new_password'] def autoname(self): """set name as Email Address""" diff --git a/frappe/model/base_document.py b/frappe/model/base_document.py index fcc8098b2b..ec89cdbe78 100644 --- a/frappe/model/base_document.py +++ b/frappe/model/base_document.py @@ -619,10 +619,11 @@ class BaseDocument(object): def _save_passwords(self): '''Save password field values in __Auth table''' - if self.flags.ignore_save_passwords: + if self.flags.ignore_save_passwords is True: return for df in self.meta.get('fields', {'fieldtype': ('=', 'Password')}): + if self.flags.ignore_save_passwords and df.fieldname in self.flags.ignore_save_passwords: continue new_password = self.get(df.fieldname) if new_password and not self.is_dummy_password(new_password): # is not a dummy password like '*****'