utils.py 319 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
from flask import session, redirect, url_for

from zoe_client import ZoeClient
from zoe_web.web import web


def check_user(zoeclient: ZoeClient):
    if 'user_id' not in session:
        return redirect(url_for(web.index))
    if not zoeclient.user_check(session['user_id']):
        return redirect(url_for('index'))