本文整理汇总了Python中User.change_password方法的典型用法代码示例。如果您正苦于以下问题:Python User.change_password方法的具体用法?Python User.change_password怎么用?Python User.change_password使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User
的用法示例。
在下文中一共展示了User.change_password方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: command_guest_change_user_account_password
# 需要导入模块: import User [as 别名]
# 或者: from User import change_password [as 别名]
def command_guest_change_user_account_password(txt_user_id, txt_old_password, txt_new_password):
cleanup = Cleanup()
session = Database.create_sqlalchemy_session_push(cleanup)
if not User.check_user_account_password(session, txt_user_id, txt_old_password):
return hs_plugin.fail(reason="auth")
User.change_password(session, txt_user_id, txt_new_password)
session.commit()
cleanup.clean_all();
return hs_plugin.ok()
示例2: command_user_change_user_account_password
# 需要导入模块: import User [as 别名]
# 或者: from User import change_password [as 别名]
def command_user_change_user_account_password(txtf_user_token, txt_user_id, txt_new_password):
cleanup = Cleanup()
session = Database.create_sqlalchemy_session_push(cleanup)
if not Permission.get_user_permission(session, txtf_user_token, "admin"):
return hs_plugin.fail(reason="permission")
if not User.check_user_account_exist(session, txt_user_id):
return hs_plugin.fail(reason="txt_user_id")
User.change_password(session, txt_user_id, txt_new_password)
session.commit()
cleanup.clean_all();
return hs_plugin.ok()