Repository: citusdata/django-multitenant (language: python)

Issue:
Release 4.1.0 overwrote 4.0.0 wheel
It looks like the publication of the 4.1.0 release overwrote the 4.0.0 wheels on pypi.

![image](https://github.com/citusdata/django-multitenant/assets/120819/cd14e91c-369a-47f4-9d8a-531acba93d2c)

The broken 4.0.0 wheel now produces this error:

```python
AttributeError: 'Settings' object has no attribute 'TENANT_USE_ASGIREF'
```

The asgiref support should not be part of 4.0.0 but only of 4.1.0.


Discussion / hints:
We needed to add TENANT_USE_ASGIREF = False
to our applications settings.py to avoid an error we were getting after the happened.  FYI.  
Yes that's how we hot fixed the error too.

Fix patch:
diff --git a/django_multitenant/utils.py b/django_multitenant/utils.py
index c3a9d2d..6ba0947 100644
--- a/django_multitenant/utils.py
+++ b/django_multitenant/utils.py
@@ -1,10 +1,10 @@
 import inspect
 
 from django.apps import apps
-from django.conf import settings
+from .settings import TENANT_USE_ASGIREF
 
 
-if settings.TENANT_USE_ASGIREF:
+if TENANT_USE_ASGIREF:
     # asgiref must be installed, its included with Django >= 3.0
     from asgiref.local import Local as local
 else:


Test patch:
diff --git a/django_multitenant/tests/test_utils.py b/django_multitenant/tests/test_utils.py
index 0c75dff..926d4e8 100644
--- a/django_multitenant/tests/test_utils.py
+++ b/django_multitenant/tests/test_utils.py
@@ -58,6 +58,7 @@ def test_tenant_persists_from_async_task_to_thread(self):
         account = projects[0].account
 
         with self.settings(TENANT_USE_ASGIREF=True):
+            importlib.reload(sys.modules["django_multitenant.settings"])
             importlib.reload(sys.modules["django_multitenant.utils"])
 
             # Set the tenant in task
@@ -66,6 +67,7 @@ def test_tenant_persists_from_async_task_to_thread(self):
             unset_current_tenant()
 
         with self.settings(TENANT_USE_ASGIREF=False):
+            importlib.reload(sys.modules["django_multitenant.settings"])
             importlib.reload(sys.modules["django_multitenant.utils"])
 
             # Set the tenant in task