fix(typing): solucionar loader NoneType y carga modular dinamica en moodle_replicator
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
],
|
||||
"extraPaths": [
|
||||
"backend",
|
||||
"scripts",
|
||||
"backend/venv/Lib/site-packages"
|
||||
],
|
||||
"venvPath": "backend",
|
||||
|
||||
@@ -594,7 +594,7 @@ def run_replication(
|
||||
transformed_users = [MoodleUserTransformer.transform_user(u) for u in raw_participants]
|
||||
all_exported_data[cid] = transformed_users
|
||||
|
||||
if dry_run:
|
||||
if dry_run or not loader:
|
||||
print(f"[DRY-RUN] Se habrían procesado {len(transformed_users)} usuarios para curso local {local_course_id}.")
|
||||
continue
|
||||
|
||||
@@ -656,10 +656,12 @@ 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 importlib
|
||||
scripts_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
if scripts_dir not in sys.path:
|
||||
sys.path.insert(0, scripts_dir)
|
||||
_imp_mod = importlib.import_module("import_moodle_to_app")
|
||||
import_moodle_users = getattr(_imp_mod, "import_moodle_users")
|
||||
import_moodle_users(export_path)
|
||||
except Exception as e:
|
||||
print(f"[!] Error al sincronizar con la base de datos de la App: {e}")
|
||||
|
||||
Reference in New Issue
Block a user