feat: plantilla base workspace SaaS
This commit is contained in:
10
backend/core/context.py
Normal file
10
backend/core/context.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from contextvars import ContextVar
|
||||
from typing import Optional, Dict, Any
|
||||
|
||||
_user_context: ContextVar[Optional[Dict[str, Any]]] = ContextVar("user_context", default=None)
|
||||
|
||||
def get_user_context() -> Optional[Dict[str, Any]]:
|
||||
return _user_context.get()
|
||||
|
||||
def set_user_context(user: Dict[str, Any]) -> None:
|
||||
_user_context.set(user)
|
||||
Reference in New Issue
Block a user