def load_user(): g.user = get_current_user() from gather.account.models import Account token = request.headers.get("token", None) if token: g.token_user = Account.query.filter_by(api_token=token).first() else: g.token_user = None
def load_user(): g.user = get_current_user() if "page" in request.args: page = request.args.get("page", 1) try: page = int(page) except: pass else: return redirect(url_for_other_page(page), 301)
def load_user(): g.user = get_current_user()