Skip to content
Snippets Groups Projects
Commit 7d46bda9 authored by Tomáš Valenta's avatar Tomáš Valenta
Browse files

don't import model before apps ready

parent e4e61e06
No related branches found
No related tags found
1 merge request!9Release
Pipeline #15160 passed
...@@ -8,8 +8,6 @@ from timeit import default_timer ...@@ -8,8 +8,6 @@ from timeit import default_timer
from asgiref.sync import sync_to_async from asgiref.sync import sync_to_async
from channels.generic.websocket import AsyncWebsocketConsumer from channels.generic.websocket import AsyncWebsocketConsumer
from .models import OngoingTimer
running_timer_threads = [] running_timer_threads = []
...@@ -71,6 +69,8 @@ def tick_timer(timer, iteration: int, total_seconds: int) -> None: ...@@ -71,6 +69,8 @@ def tick_timer(timer, iteration: int, total_seconds: int) -> None:
class TimerConsumer(AsyncWebsocketConsumer): class TimerConsumer(AsyncWebsocketConsumer):
async def connect(self) -> None: async def connect(self) -> None:
from .models import OngoingTimer
timer_id = self.scope["url_route"]["kwargs"]["id"] timer_id = self.scope["url_route"]["kwargs"]["id"]
timer = await sync_to_async(OngoingTimer.objects.filter(id=timer_id).first)() timer = await sync_to_async(OngoingTimer.objects.filter(id=timer_id).first)()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment