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