forked from ScoDoc/DocScoDoc
Fix import dept (si minuscules dans le nom).
This commit is contained in:
parent
2790951335
commit
bfad156ac2
@ -222,10 +222,12 @@ def import_scodoc7_users(): # import-scodoc7-users
|
||||
|
||||
@app.cli.command()
|
||||
@click.argument("dept")
|
||||
@click.argument("dept_db_name")
|
||||
@with_appcontext
|
||||
def import_scodoc7_dept(dept): # import-scodoc7-dept
|
||||
"""Import département ScoDoc7"""
|
||||
tools.import_scodoc7_dept(dept)
|
||||
def import_scodoc7_dept(dept: str, dept_db_name: str): # import-scodoc7-dept
|
||||
"""Import département ScoDoc 7: dept: InfoComm, dept_db_name: SCOINFOCOMM"""
|
||||
dept_db_uri = f"postgresql:///{dept_db_name}"
|
||||
tools.import_scodoc7_dept(dept, dept_db_uri)
|
||||
|
||||
|
||||
@app.cli.command()
|
||||
|
@ -421,5 +421,5 @@ SCO7_TABLES_ORDONNEES = [
|
||||
|
||||
"""
|
||||
from tools.import_scodoc7_dept import *
|
||||
import_scodoc7_dept( "RT" )
|
||||
import_scodoc7_dept( "RT", "SCORT" )
|
||||
"""
|
@ -122,11 +122,12 @@ su -c "(cd $SCODOC_DIR && flask import-scodoc7-users)" "$SCODOC_USER"
|
||||
for f in "$SCODOC_VAR_DIR"/config/depts/*.cfg
|
||||
do
|
||||
dept=$(basename "${f%.*}")
|
||||
db_name=$(echo "SCO$dept" | tr "[:lower:]" "[:upper:]")
|
||||
echo
|
||||
echo "----------------------------------------------"
|
||||
echo "| MIGRATION DU DEPARTEMENT $dept"
|
||||
echo "----------------------------------------------"
|
||||
su -c "(cd $SCODOC_DIR && flask import-scodoc7-dept $dept)" "$SCODOC_USER"
|
||||
su -c "(cd $SCODOC_DIR && flask import-scodoc7-dept $dept $db_name)" "$SCODOC_USER"
|
||||
echo "restarting postgresql server..."
|
||||
systemctl restart postgresql
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user