Salil Satpute
Salil Satpute

Reputation: 1

Django: Multi Tenancy : Override Tenant Context

I have overridden django_tenants.utils.tenant_context to activate a timezone specific to the tenant.

class NewTenantContext(tenant_context): ...

I can use the new context like this

with ALSTenantContext(tenant): ...

All this works fine for a specific process to start for a tenant.

But how do I make sure NewTenantContext is used when tenant is set from Admin or API?

Upvotes: 0

Views: 255

Answers (1)

Salil Satpute
Salil Satpute

Reputation: 1

I am able to resolve this by overriding middleware django_tenants.middleware.TenantMainMiddleware

Upvotes: 0

Related Questions