sbt-idp/cope2n-api/fwd_api/middleware/local_storage.py

10 lines
206 B
Python

from threading import local
_thread_locals = local()
def get_current_request():
return getattr(_thread_locals, 'request', None)
def set_current_request(request):
_thread_locals.request = request