@mod.before_request
def before_request():
    g.user = None
    if 'user_id' in session:
        g.user = User.query.get(session['user_id'])
dataset/ETHPy150Open codelucas/flask_reddit/flask_reddit/threads/views.py/before_request/original