From 7a0a04bdb3f12d03bb6bb7829f82a2bc81e7aee9 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 19 Sep 2021 20:44:26 +0200 Subject: [PATCH] fix install --- sco_version.py | 2 +- tools/configure-scodoc9.sh | 3 ++- tools/debian/postrm | 10 ++++++---- tools/import_scodoc7_dept.py | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/sco_version.py b/sco_version.py index a7ecb58ad..90ed4ec72 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.0.30" +SCOVERSION = "9.0.31" SCONAME = "ScoDoc" diff --git a/tools/configure-scodoc9.sh b/tools/configure-scodoc9.sh index b1c18ec5e..fdb5e3b7f 100755 --- a/tools/configure-scodoc9.sh +++ b/tools/configure-scodoc9.sh @@ -120,7 +120,7 @@ then echo echo "Création des tables et du compte admin" echo - msg="Saisir le mot de passe de l\'administrateur \(admin\):" + msg="Saisir le mot de passe de l\'administrateur \(admin, via le web\):" su -c "(cd /opt/scodoc; source venv/bin/activate; flask db upgrade; flask sco-db-init; echo; echo $msg; flask user-password admin)" "$SCODOC_USER" || die "Erreur: sco-db-init" echo echo "Base initialisée et admin créé." @@ -135,6 +135,7 @@ systemctl start scodoc9 echo echo "Service configuré et démarré." echo "Vous pouvez vous connecter en web et vous identifier comme \"admin\"." +echo "ou bien importer vos données et comptes de la version ScoDoc 7." echo diff --git a/tools/debian/postrm b/tools/debian/postrm index a01b1a38c..c657afd6f 100755 --- a/tools/debian/postrm +++ b/tools/debian/postrm @@ -4,16 +4,18 @@ # Ne touche pas aux données (/opt/scodoc-data) # N'enlève complètement /opt/scodoc qui si --purge -systemctl stop scodoc9 -systemctl disable scodoc9 +systemctl stop scodoc9 || echo "scodoc9 non lancé" +systemctl disable scodoc9 || echo "scodoc9 systemd non configuré" if [ "$#" == 1 ] && [ "$1" == "purge" ] then /bin/rm -rf /opt/scodoc - /bin/rm -f scodoc9.service + /bin/rm -f /etc/systemd/system/scodoc9.service /bin/rm -f /etc/systemd/system/scodoc-updater.service /bin/rm -f /etc/systemd/system/scodoc-updater.timer /bin/rm -f /etc/nginx/sites-enabled/scodoc9.nginx + systemctl daemon-reload fi -systemctl reload nginx +systemctl reload nginx || echo 'nginx non fonctionnel' + diff --git a/tools/import_scodoc7_dept.py b/tools/import_scodoc7_dept.py index a9a727f5c..cedf0a936 100644 --- a/tools/import_scodoc7_dept.py +++ b/tools/import_scodoc7_dept.py @@ -211,7 +211,7 @@ def get_class_for_table(table): def get_boolean_columns(klass): - "return list of names of boolean attributes in this model" + "return list of names of boolean attributes in this (ScoDoc 9) model" boolean_columns = [] column_names = sqlalchemy.inspect(klass).columns.keys() for column_name in column_names: @@ -412,7 +412,8 @@ def convert_object( obj[k] = uid # Converti les booléens for k in boolean_columns: - obj[k] = bool(obj[k]) + if k in obj: + obj[k] = bool(obj[k]) # Ajoute le département si besoin: if hasattr(klass, "dept_id"):