~homeworkprod/byceps

2341dbab389243c259f2ab90020227d133e4d16c — Jochen Kupperschmidt 4 years ago 4473a80
Remove party object from `g` thread-local
2 files changed, 2 insertions(+), 4 deletions(-)

M byceps/blueprints/party/views.py
M tests/helpers.py
M byceps/blueprints/party/views.py => byceps/blueprints/party/views.py +0 -1
@@ 27,7 27,6 @@ def before_request():
    if party is None:
        raise Exception('Unknown party ID "{}".'.format(party_id))

    g.party = party.to_tuple()
    g.party_id = party.id
    g.brand_id = party.brand_id


M tests/helpers.py => tests/helpers.py +2 -3
@@ 27,9 27,8 @@ def app_context(*, config_filename=CONFIG_FILENAME_TEST_PARTY):
@contextmanager
def current_party_set(app, party):
    def handler(sender, **kwargs):
        g.party = party.to_tuple()
        g.party_id = g.party.id
        g.brand_id = g.party.brand_id
        g.party_id = party.id
        g.brand_id = party.brand_id

    with appcontext_pushed.connected_to(handler, app):
        yield