def new_user(resp): session['openid'] = resp.identity_url if db.exist_user(session['openid']) is None: db.newAccount(session['openid'], "", resp.fullname, "", resp.email, "open") return redirect(oid.get_next_url())
def set_user_if_logged_in(): g.user = db.exist_user(session.get('openid', ''))