fix websockets issues
This commit is contained in:
parent
5d9109e526
commit
b13fc1fba4
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.2.12 on 2022-04-02 15:38
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounts', '0030_auto_20211104_0221'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='user',
|
||||
name='date_format',
|
||||
field=models.CharField(blank=True, default='MMM-DD-YYYY - HH:mm', max_length=30),
|
||||
),
|
||||
]
|
|
@ -48,6 +48,9 @@ class User(AbstractUser, BaseAuditModel):
|
|||
client_tree_splitter = models.PositiveIntegerField(default=11)
|
||||
loading_bar_color = models.CharField(max_length=255, default="red")
|
||||
clear_search_when_switching = models.BooleanField(default=True)
|
||||
date_format = models.CharField(
|
||||
max_length=30, blank=True, default="MMM-DD-YYYY - HH:mm"
|
||||
)
|
||||
is_installer_user = models.BooleanField(default=False)
|
||||
last_login_ip = models.GenericIPAddressField(default=None, blank=True, null=True)
|
||||
|
||||
|
|
|
@ -73,6 +73,6 @@ class DashInfo(AsyncJsonWebsocketConsumer):
|
|||
|
||||
async def send_dash_info(self):
|
||||
while self.connected:
|
||||
c = self.get_dashboard_info()
|
||||
c = await self.get_dashboard_info()
|
||||
await self.send_json(c)
|
||||
await asyncio.sleep(30)
|
||||
|
|
|
@ -234,7 +234,7 @@ class KnoxAuthMiddlewareInstance:
|
|||
self.app = app
|
||||
|
||||
async def __call__(self, scope, receive, send):
|
||||
scope["user"] = get_user(scope["query_string"])
|
||||
scope["user"] = await get_user(scope["query_string"])
|
||||
|
||||
return await self.app(scope, receive, send)
|
||||
|
||||
|
|
Loading…
Reference in New Issue