Интегрирован wesp в сайт
CI / quality (push) Canceled after 0s

This commit is contained in:
влад
2026-07-17 12:57:18 +03:00
parent 5dfa06ddbe
commit 355c0ef9f1
883 changed files with 194576 additions and 177 deletions
@@ -0,0 +1,27 @@
#!/usr/bin/env python3
"""Ручной запуск разового seed nutrients (обычно не нужен — выполняется при старте WESP)."""
from __future__ import annotations
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
from app import create_app
from app.lab.commands.seed_demo_component_nutrients import seed_demo_component_nutrients_once
def main() -> int:
force = "--force" in sys.argv
app = create_app()
with app.app_context():
result = seed_demo_component_nutrients_once(force=force)
print(result)
return 0 if result.get("seeded") or result.get("reason") == "already_done" else 1
if __name__ == "__main__":
raise SystemExit(main())