forked from ScoDoc/DocScoDoc
fix retrait semestre d'un export Apo
This commit is contained in:
parent
29221666a4
commit
35f23995aa
@ -176,7 +176,7 @@ def _send_db(ano_db_name):
|
|||||||
"""Dump this (anonymized) database and send it to tech support"""
|
"""Dump this (anonymized) database and send it to tech support"""
|
||||||
log(f"dumping anonymized database {ano_db_name}")
|
log(f"dumping anonymized database {ano_db_name}")
|
||||||
try:
|
try:
|
||||||
data = subprocess.check_output(
|
dump = subprocess.check_output(
|
||||||
f"pg_dump --format=custom {ano_db_name}", shell=1
|
f"pg_dump --format=custom {ano_db_name}", shell=1
|
||||||
)
|
)
|
||||||
except subprocess.CalledProcessError as e:
|
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}")
|
raise ScoValueError(f"erreur lors de l'anonymisation de la base {ano_db_name}")
|
||||||
|
|
||||||
log("uploading anonymized dump...")
|
log("uploading anonymized dump...")
|
||||||
files = {"file": (ano_db_name + ".dump", data)}
|
files = {"file": (ano_db_name + ".dump", dump)}
|
||||||
r = requests.post(
|
r = requests.post(
|
||||||
scu.SCO_DUMP_UP_URL,
|
scu.SCO_DUMP_UP_URL,
|
||||||
files=files,
|
files=files,
|
||||||
|
@ -171,7 +171,7 @@ class SemSet(dict):
|
|||||||
def remove(self, formsemestre_id):
|
def remove(self, formsemestre_id):
|
||||||
ndb.SimpleQuery(
|
ndb.SimpleQuery(
|
||||||
"""DELETE FROM notes_semset_formsemestre
|
"""DELETE FROM notes_semset_formsemestre
|
||||||
WHERE id=%(semset_id)s
|
WHERE semset_id=%(semset_id)s
|
||||||
AND formsemestre_id=%(formsemestre_id)s
|
AND formsemestre_id=%(formsemestre_id)s
|
||||||
""",
|
""",
|
||||||
{"formsemestre_id": formsemestre_id, "semset_id": self.semset_id},
|
{"formsemestre_id": formsemestre_id, "semset_id": self.semset_id},
|
||||||
|
Loading…
Reference in New Issue
Block a user