Fix archive (dup requests), + fix broken link

This commit is contained in:
Emmanuel Viennet 2023-03-16 15:16:04 +01:00 committed by iziram
parent c6f81d1301
commit 1f818da064
2 changed files with 6 additions and 3 deletions

View File

@ -226,15 +226,18 @@ class BaseArchiver(object):
def create_obj_archive(self, oid: int, description: str):
"""Creates a new archive for this object and returns its id."""
# id suffixé par YYYY-MM-DD-hh-mm-ss
archive_id = (
self.get_obj_dir(oid)
+ os.path.sep
+ "-".join(["%02d" % x for x in time.localtime()[:6]])
+ "-".join(["{x:02d}" for x in time.localtime()[:6]])
)
log(f"creating archive: {archive_id}")
try:
scu.GSL.acquire()
os.mkdir(archive_id) # if exists, raises FileExistsError
os.mkdir(archive_id)
except FileExistsError: # directory already exists !
pass
finally:
scu.GSL.release()
self.store(archive_id, "_description.txt", description)

View File

@ -335,7 +335,7 @@ def formsemestre_pvjury_pdf(formsemestre_id, group_ids: list[int] = None, etudid
# PV pour ce seul étudiant:
etud = Identite.query.get_or_404(etudid)
etuddescr = f"""<a class="discretelink" href="{
url_for("notes.ficheEtud", scodoc_dept=g.scodoc_dept, etudid=etudid)
url_for("scolar.ficheEtud", scodoc_dept=g.scodoc_dept, etudid=etudid)
}">{etud.nomprenom}</a>"""
etudids = [etudid]
else: