Unverified Commit 4f7c668c authored by BaiJiangJie's avatar BaiJiangJie Committed by GitHub

Merge pull request #3209 from jumpserver/dev_initnodes

[Bugfix] 修改初始化一些节点时,assets_node表不存在的问题
parents c0afeba2 9f2e49c9
from __future__ import unicode_literals
from django.apps import AppConfig
from django.db.models.signals import post_migrate
def initial_some_nodes():
from .models import Node
Node.initial_some_nodes()
def initial_some_nodes_callback(sender, **kwargs):
initial_some_nodes()
class AssetsConfig(AppConfig):
......@@ -9,5 +19,7 @@ class AssetsConfig(AppConfig):
def ready(self):
super().ready()
from . import signals_handler
from .models import Node
Node.initial_some_nodes()
try:
initial_some_nodes()
except Exception:
post_migrate.connect(initial_some_nodes_callback, sender=self)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment