From 35f23995aad3b5f3c2c0cf0bdb4a06a0d7bc1f08 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 19 Sep 2021 16:19:02 +0200 Subject: [PATCH] fix retrait semestre d'un export Apo --- app/scodoc/sco_dump_db.py | 4 ++-- app/scodoc/sco_semset.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/scodoc/sco_dump_db.py b/app/scodoc/sco_dump_db.py index 40d619da..126d2783 100644 --- a/app/scodoc/sco_dump_db.py +++ b/app/scodoc/sco_dump_db.py @@ -176,7 +176,7 @@ def _send_db(ano_db_name): """Dump this (anonymized) database and send it to tech support""" log(f"dumping anonymized database {ano_db_name}") try: - data = subprocess.check_output( + dump = subprocess.check_output( f"pg_dump --format=custom {ano_db_name}", shell=1 ) except subprocess.CalledProcessError as e: @@ -184,7 +184,7 @@ def _send_db(ano_db_name): raise ScoValueError(f"erreur lors de l'anonymisation de la base {ano_db_name}") log("uploading anonymized dump...") - files = {"file": (ano_db_name + ".dump", data)} + files = {"file": (ano_db_name + ".dump", dump)} r = requests.post( scu.SCO_DUMP_UP_URL, files=files, diff --git a/app/scodoc/sco_semset.py b/app/scodoc/sco_semset.py index 23a4c6e2..7b71d7c2 100644 --- a/app/scodoc/sco_semset.py +++ b/app/scodoc/sco_semset.py @@ -171,7 +171,7 @@ class SemSet(dict): def remove(self, formsemestre_id): ndb.SimpleQuery( """DELETE FROM notes_semset_formsemestre - WHERE id=%(semset_id)s + WHERE semset_id=%(semset_id)s AND formsemestre_id=%(formsemestre_id)s """, {"formsemestre_id": formsemestre_id, "semset_id": self.semset_id},