From a5108547414b3795c6a299758b2581e2e84a6d3a Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 23 Nov 2020 07:58:22 +0000 Subject: [PATCH] fix core settings for install script --- api/tacticalrmm/core/models.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api/tacticalrmm/core/models.py b/api/tacticalrmm/core/models.py index ce654b84..d1204773 100644 --- a/api/tacticalrmm/core/models.py +++ b/api/tacticalrmm/core/models.py @@ -72,6 +72,15 @@ class CoreSettings(BaseAuditModel): if not self.pk and CoreSettings.objects.exists(): raise ValidationError("There can only be one CoreSettings instance") + # for install script + if not self.pk: + try: + self.mesh_site = settings.MESH_SITE + self.mesh_username = settings.MESH_USERNAME + self.mesh_token = settings.MESH_TOKEN_KEY + except: + pass + return super(CoreSettings, self).save(*args, **kwargs) def __str__(self):