application.logger.debug("Connected to users database")
cur.execute("select user_index,login from users where email=%s and expires_at between now()+'1 hour' and now()+'26 hours'",(tokendict['mail'],))
application.logger.debug(cur.mogrify("select user_index,login from users where email=%s and expires_at between now()+'1 hour' and now()+'26 hours'",(tokendict['mail'],)))
ifcur.rowcount!=0:
(uid,login)=cur.fetchone()
application.logger.debug("Found a temporary account corresponding to %s",tokendict['mail'])
cur.execute("select ws_hash from credentials where user_index=%s",(uid,))