fix(imports): resolver rutas relativas de backend.app para linter y ejecucion dual

This commit is contained in:
2026-10-16 15:42:48 -03:00
parent 6b0d0bbc77
commit b2a4f878d8
2 changed files with 16 additions and 7 deletions
+9 -3
View File
@@ -10,10 +10,16 @@ import os
import sys
import json
# Agregar backend al sys.path
sys.path.append(os.path.abspath('backend'))
sys.path.append('/opt/admin-edu-space/backend')
# Asegurar backend en sys.path
backend_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'backend'))
if backend_dir not in sys.path:
sys.path.insert(0, backend_dir)
try:
from backend.app import create_app, db
from backend.app.models.user import User
from backend.app.models.role import Role
except ImportError:
from app import create_app, db
from app.models.user import User
from app.models.role import Role
+3
View File
@@ -656,6 +656,9 @@ def main():
if args.sync_app and export_path:
try:
try:
from scripts.import_moodle_to_app import import_moodle_users
except ImportError:
from import_moodle_to_app import import_moodle_users
import_moodle_users(export_path)
except Exception as e: