[FIX] base: Changing password with false as new value
Before clicking on 'Change Password' button, a new password must be written. Otherwise an error was raised: TypeError: secret must be unicode or bytes, not bool. opw:777921
This commit is contained in:
@@ -19704,6 +19704,12 @@ msgstr ""
|
||||
msgid "yes"
|
||||
msgstr ""
|
||||
|
||||
#. module: base
|
||||
#: code:addons/base/res/res_users.py:955
|
||||
#, python-format
|
||||
msgid "Before clicking on 'Change Password', you have to write a new password."
|
||||
msgstr ""
|
||||
|
||||
#. module: base
|
||||
#: model:res.country,name:base.ax
|
||||
msgid "Åland Islands"
|
||||
|
||||
@@ -950,6 +950,8 @@ class ChangePasswordUser(models.TransientModel):
|
||||
@api.multi
|
||||
def change_password_button(self):
|
||||
for line in self:
|
||||
if not line.new_passwd:
|
||||
raise UserError(_("Before clicking on 'Change Password', you have to write a new password."))
|
||||
line.user_id.write({'password': line.new_passwd})
|
||||
# don't keep temporary passwords in the database longer than necessary
|
||||
self.write({'new_passwd': False})
|
||||
|
||||
Reference in New Issue
Block a user