Files
goodtimes/accounts/utils.py
rizwanisready db213d3228 wrong commit
2024-02-29 13:25:50 +05:30

14 lines
289 B
Python

import threading
class UserContext:
_thread_local_data = threading.local()
@classmethod
def set_user(cls, user):
cls._thread_local_data.current_user = user
@classmethod
def get_user(cls):
return getattr(cls._thread_local_data, "current_user", None)