aboutsummaryrefslogtreecommitdiff
path: root/gn2/utility/after.py
blob: 5f802d351f169cc6ddf969a715cb96f0f97f9b32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""
See: http://flask.pocoo.org/docs/patterns/deferredcallbacks/#deferred-callbacks

"""

from flask import g

from gn2.wqflask import app


def after_this_request(f):
    if not hasattr(g, 'after_request_callbacks'):
        g.after_request_callbacks = []
    g.after_request_callbacks.append(f)
    return f