Advertisement
Guest User

Untitled

a guest
Oct 26th, 2022
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.18 KB | None | 0 0
  1. SynchronousOnlyOperation: You cannot call this from an async context - use a thread or sync_to_async.
  2.   File "django/core/handlers/exception.py", line 47, in inner
  3.     response = get_response(request)
  4.   File "django/utils/deprecation.py", line 116, in __call__
  5.     response = self.process_request(request)
  6.   File "helpers/tenant.py", line 33, in process_request
  7.     tenant = self.get_tenant(domain_model, hostname)
  8.   File "django_tenants/middleware/main.py", line 27, in get_tenant
  9.     domain = domain_model.objects.select_related('tenant').get(domain=hostname)
  10.   File "django/db/models/query.py", line 431, in get
  11.     num = len(clone)
  12.   File "django/db/models/query.py", line 262, in __len__
  13.     self._fetch_all()
  14.   File "django/db/models/query.py", line 1324, in _fetch_all
  15.     self._result_cache = list(self._iterable_class(self))
  16.   File "django/db/models/query.py", line 51, in __iter__
  17.     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  18.   File "django/db/models/sql/compiler.py", line 1173, in execute_sql
  19.     cursor = self.connection.cursor()
  20.   File "django/utils/asyncio.py", line 24, in inner
  21.     raise SynchronousOnlyOperation(message)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement