[UPDT] HORILLA AUTOMATIONS: Updated apps.py to skip start_automation when executing some django manage commands
This commit is contained in:
@@ -40,10 +40,15 @@ class HorillaAutomationConfig(AppConfig):
|
||||
model_choices[:] = list(set(model_choices)) # Update in-place
|
||||
|
||||
# Only start automation when running the server
|
||||
if (
|
||||
len(sys.argv) >= 2
|
||||
and sys.argv[1] == "runserver"
|
||||
and os.environ.get("RUN_MAIN") == "true"
|
||||
if not any(
|
||||
cmd in sys.argv
|
||||
for cmd in [
|
||||
"makemigrations",
|
||||
"migrate",
|
||||
"compilemessages",
|
||||
"flush",
|
||||
"shell",
|
||||
]
|
||||
):
|
||||
from horilla_automations.signals import start_automation
|
||||
|
||||
|
||||
@@ -66,7 +66,12 @@ def refresh_automations(request):
|
||||
Method to refresh automation signals
|
||||
"""
|
||||
refreshed = False
|
||||
|
||||
print(REFRESH_METHODS)
|
||||
print()
|
||||
print()
|
||||
print(
|
||||
"___________________________________________________________________________________"
|
||||
)
|
||||
if REFRESH_METHODS.get("clear_connection"):
|
||||
REFRESH_METHODS["clear_connection"]()
|
||||
refreshed = True
|
||||
|
||||
Reference in New Issue
Block a user