From f6924e7b520e8cc2698eb7495445bd199ff5b975 Mon Sep 17 00:00:00 2001 From: valq7711 Date: Mon, 6 Sep 2021 09:41:26 +0300 Subject: [PATCH] minor improvements --- apps/safe_fixtures/__init__.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/apps/safe_fixtures/__init__.py b/apps/safe_fixtures/__init__.py index ca2ddc012..6428cc44f 100644 --- a/apps/safe_fixtures/__init__.py +++ b/apps/safe_fixtures/__init__.py @@ -21,13 +21,6 @@ SafeFixtures.HTTP = HTTP -class SF(SafeFixtures): - session = Session(secret="some secret") - index_html = Template('index.html') - db = db - user_in = None - - class RequiresUser(Fixture): def __init__(self, session): @@ -39,7 +32,12 @@ def on_request(self): if not user or not user.get('id'): raise HTTP(401) -SF.user_in = RequiresUser(SF.session) + +class SF(SafeFixtures): + session = Session(secret="some secret") + index_html = Template('index.html') + db = db + user_in = RequiresUser(session) sf = SF()