fix core settings for install script

This commit is contained in:
wh1te909 2020-11-23 07:58:22 +00:00
parent 8935ce4ccf
commit a510854741
1 changed files with 9 additions and 0 deletions

View File

@ -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):