File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,10 @@ def after_request_execute(response):
162
162
163
163
@app .teardown_appcontext
164
164
def teardown_db (exception = None ):
165
+ # drop reference to "user" (if it exists)
166
+ if "user" in g :
167
+ g .pop ("user" )
168
+
165
169
# close the db connection
166
170
db = g .pop ("db" , None )
167
171
Original file line number Diff line number Diff line change @@ -81,7 +81,10 @@ def require_api_key() -> bool:
81
81
def _get_current_user ():
82
82
if "user" not in g :
83
83
api_key = resolve_auth_token ()
84
- g .user = User .find_user (api_key = api_key )
84
+ if api_key :
85
+ g .user = User .find_user (api_key = api_key )
86
+ else :
87
+ g .user = None
85
88
return g .user
86
89
87
90
@@ -122,6 +125,8 @@ def decorated_function(*args, **kwargs):
122
125
123
126
124
127
def update_key_last_time_used (user ):
128
+ # TODO: reenable this once cc<-->aws latency issues are sorted out, or maybe do this call asynchronously
129
+ return
125
130
if user :
126
131
# update last usage for this user's api key to "now()"
127
132
r = redis .Redis (host = REDIS_HOST , password = REDIS_PASSWORD )
You can’t perform that action at this time.
0 commit comments