Make sure localconfig object is only created for default db.

This commit is contained in:
Antoine Nguyen
2017-03-02 18:13:18 +01:00
parent b48a2d942c
commit 769d9a3243
+3
View File
@@ -77,6 +77,9 @@ def log_object_removal(sender, instance, **kwargs):
def create_local_config(sender, **kwargs):
"""Create local config if needed."""
using = kwargs.get("using")
if using != "default":
return
if models.LocalConfig.objects.using(kwargs["using"]).exists():
return
models.LocalConfig.objects.create(