|
|
@@ -218,7 +218,8 @@ def _save_job(job):
|
|
|
|
|
|
if not name:
|
|
|
flash("Le nom est requis.", "error")
|
|
|
- return render_template("job_form.html", job=job, ynh_apps=_get_ynh_apps())
|
|
|
+ return render_template("job_form.html", job=job, ynh_apps=_get_ynh_apps(),
|
|
|
+ destinations=Destination.query.filter_by(enabled=True).all())
|
|
|
|
|
|
cfg = {}
|
|
|
if job_type == "ynh_app":
|
|
|
@@ -229,13 +230,15 @@ def _save_job(job):
|
|
|
dbname = f.get("db_database", "").strip()
|
|
|
if not dbname:
|
|
|
flash("Le nom de la base de données est requis.", "error")
|
|
|
- return render_template("job_form.html", job=job, ynh_apps=_get_ynh_apps())
|
|
|
+ return render_template("job_form.html", job=job, ynh_apps=_get_ynh_apps(),
|
|
|
+ destinations=Destination.query.filter_by(enabled=True).all())
|
|
|
cfg = {"database": dbname}
|
|
|
elif job_type == "custom_dir":
|
|
|
source_path = f.get("source_path", "").strip().rstrip("/")
|
|
|
if not source_path or not source_path.startswith("/"):
|
|
|
flash("Le chemin source doit être un chemin absolu (ex: /opt/monapp).", "error")
|
|
|
- return render_template("job_form.html", job=job, ynh_apps=_get_ynh_apps())
|
|
|
+ return render_template("job_form.html", job=job, ynh_apps=_get_ynh_apps(),
|
|
|
+ destinations=Destination.query.filter_by(enabled=True).all())
|
|
|
excludes = [e.strip() for e in f.get("excludes", "").splitlines() if e.strip()]
|
|
|
restore_cfg = {}
|
|
|
user_name = f.get("restore_user_name", "").strip()
|