diff --git a/api/tacticalrmm/accounts/migrations/0031_user_date_format.py b/api/tacticalrmm/accounts/migrations/0031_user_date_format.py new file mode 100644 index 00000000..a9cbaacf --- /dev/null +++ b/api/tacticalrmm/accounts/migrations/0031_user_date_format.py @@ -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), + ), + ] diff --git a/api/tacticalrmm/accounts/models.py b/api/tacticalrmm/accounts/models.py index 0caa3920..f72b0fb7 100644 --- a/api/tacticalrmm/accounts/models.py +++ b/api/tacticalrmm/accounts/models.py @@ -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) diff --git a/api/tacticalrmm/core/consumers.py b/api/tacticalrmm/core/consumers.py index 9d905baf..914fd42a 100644 --- a/api/tacticalrmm/core/consumers.py +++ b/api/tacticalrmm/core/consumers.py @@ -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) diff --git a/api/tacticalrmm/tacticalrmm/utils.py b/api/tacticalrmm/tacticalrmm/utils.py index 9e7f5dcf..0e6a4f37 100644 --- a/api/tacticalrmm/tacticalrmm/utils.py +++ b/api/tacticalrmm/tacticalrmm/utils.py @@ -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)