Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (8 sloc) 254 Bytes
from typing import Optional
import threading
from .models import Tenant
class State(threading.local):
current_tenant = None
def get_current_tenant() -> Optional[Tenant]:
"""Retrieve current tenant from TLS"""
return State.current_tenant
You can’t perform that action at this time.