0

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?

import random
  • 3,054
  • 1
  • 17
  • 22
  • I have overridden django_tenants.utils.tenant_context to implement tenant specific time zone. Is there any other mechanism to implement the same. – Salil Satpute Oct 25 '22 at 02:41

1 Answers1

0

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