1
0
forked from ScoDoc/ScoDoc

fix install

This commit is contained in:
Emmanuel Viennet 2021-09-19 20:44:26 +02:00
parent 35f23995aa
commit 7a0a04bdb3
4 changed files with 12 additions and 8 deletions

View File

@ -1,7 +1,7 @@
# -*- mode: python -*-
# -*- coding: utf-8 -*-
SCOVERSION = "9.0.30"
SCOVERSION = "9.0.31"
SCONAME = "ScoDoc"

View File

@ -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

View File

@ -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'

View File

@ -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"):