From d7e6a7d7141c1bb4b65714c4e8920f026deef06a Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 19 Sep 2021 16:13:57 +0200 Subject: [PATCH] ameliore assistance --- app/scodoc/sco_bulletins.py | 1 - app/scodoc/sco_dump_db.py | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/scodoc/sco_bulletins.py b/app/scodoc/sco_bulletins.py index 20a29f4ec..ec691a07f 100644 --- a/app/scodoc/sco_bulletins.py +++ b/app/scodoc/sco_bulletins.py @@ -994,7 +994,6 @@ def mail_bulletin(formsemestre_id, I, pdfdata, filename, recipient_addr): # Attach pdf msg.attach(filename, scu.PDF_MIMETYPE, pdfdata) - breakpoint() log("mail bulletin a %s" % recipient_addr) email.send_message(msg) diff --git a/app/scodoc/sco_dump_db.py b/app/scodoc/sco_dump_db.py index 457e2d0ee..40d619dad 100644 --- a/app/scodoc/sco_dump_db.py +++ b/app/scodoc/sco_dump_db.py @@ -174,17 +174,17 @@ def _get_scodoc_serial(): def _send_db(ano_db_name): """Dump this (anonymized) database and send it to tech support""" - log("dumping anonymized database {}".format(ano_db_name)) + log(f"dumping anonymized database {ano_db_name}") try: - data = subprocess.check_output("pg_dump {} | gzip".format(ano_db_name), shell=1) - except subprocess.CalledProcessError as e: - log("sco_dump_and_send_db: exception in anonymisation: {}".format(e)) - raise ScoValueError( - "erreur lors de l'anonymisation de la base {}".format(ano_db_name) + data = subprocess.check_output( + f"pg_dump --format=custom {ano_db_name}", shell=1 ) + except subprocess.CalledProcessError as e: + log(f"sco_dump_and_send_db: exception in anonymisation: {e}") + raise ScoValueError(f"erreur lors de l'anonymisation de la base {ano_db_name}") log("uploading anonymized dump...") - files = {"file": (ano_db_name + ".gz", data)} + files = {"file": (ano_db_name + ".dump", data)} r = requests.post( scu.SCO_DUMP_UP_URL, files=files,