MCPcopy Create free account
hub / github.com/ddserver/ddserver / post_lostpass_setnew

Function post_lostpass_setnew

ddserver/interface/pages/lostpasswd.py:89–106  ·  view source on GitHub ↗
(user,
                         data,
                         db,
                         messages)

Source from the content-addressed store, hash-verified

87@require(db = 'ddserver.db:Database',
88 messages = 'ddserver.interface.message:MessageManager')
89def post_lostpass_setnew(user,
90 data,
91 db,
92 messages):
93 encrypted_password = pwd.encrypt(data.password)
94
95 with db.cursor() as cur:
96 cur.execute('''
97 UPDATE `users`
98 SET `password` = %(encrypted_password)s,
99 `authcode` = NULL
100 WHERE `id` = %(user_id)s
101 ''', {'encrypted_password': encrypted_password,
102 'user_id': user.id})
103
104 messages.success('Your new password has been set.')
105
106 bottle.redirect('/')
107
108
109

Callers

nothing calls this directly

Calls 2

cursorMethod · 0.80
successMethod · 0.80

Tested by

no test coverage detected