Running the old version.
[edumed.git] / wtem / middleware.py
1 # -*- coding: utf-8 -*-
2 from threading import local
3
4
5 _thread_locals = local()
6
7
8 def get_current_request():
9     return getattr(_thread_locals, 'request', None)
10
11
12 class ThreadLocalMiddleware(object):
13     @staticmethod
14     def process_request(request):
15         _thread_locals.request = request