fix retrait semestre d'un export Apo

This commit is contained in:
Emmanuel Viennet 2021-09-19 16:19:02 +02:00
parent 29221666a4
commit 35f23995aa
2 changed files with 3 additions and 3 deletions

View File

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

View File

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