Fix: nom dans PV archivés

This commit is contained in:
viennet 2020-10-14 15:28:09 +02:00
parent 0ddf1faed4
commit b01a4dff13
3 changed files with 35 additions and 40 deletions

View File

@ -424,8 +424,7 @@ UE11 Découverte métiers <span class="ue_code">(code UCOD46, 16 ECTS, Apo <span
security.declareProtected(ScoView, "ScoErrorResponse")
def ScoErrorResponse(self, msg, format="html", REQUEST=None):
"""Send an error message to the client, in html or xml format.
"""
"""Send an error message to the client, in html or xml format."""
REQUEST.RESPONSE.setStatus(404, reason=msg)
if format == "html" or format == "pdf":
raise ScoValueError(msg)
@ -459,7 +458,7 @@ UE11 Découverte métiers <span class="ue_code">(code UCOD46, 16 ECTS, Apo <span
def get_preference(self, name, formsemestre_id=None):
"""Returns value of named preference.
All preferences have a sensible default value (see sco_preferences.py),
All preferences have a sensible default value (see sco_preferences.py),
this function always returns a usable value for all defined preferences names.
"""
return sco_preferences.get_base_preferences(self).get(formsemestre_id, name)
@ -491,9 +490,9 @@ UE11 Découverte métiers <span class="ue_code">(code UCOD46, 16 ECTS, Apo <span
def doc_preferences(self, REQUEST):
"""List preferences for wiki documentation"""
REQUEST.RESPONSE.setHeader("content-type", "text/plain" )
REQUEST.RESPONSE.setHeader("content-type", "text/plain")
return sco_preferences.doc_preferences(self)
# --------------------------------------------------------------------
#
# ETUDIANTS
@ -970,8 +969,7 @@ UE11 Découverte métiers <span class="ue_code">(code UCOD46, 16 ECTS, Apo <span
)
def _descr_situation_etud(self, etudid, ne=""):
"""chaine decrivant la situation actuelle de l'etudiant
"""
"""chaine decrivant la situation actuelle de l'etudiant"""
cnx = self.GetDBConnexion()
cursor = cnx.cursor(cursor_factory=ScoDocCursor)
cursor.execute(
@ -1091,8 +1089,7 @@ UE11 Découverte métiers <span class="ue_code">(code UCOD46, 16 ECTS, Apo <span
security.declareProtected(ScoView, "doSuppressAnnotation")
def doSuppressAnnotation(self, etudid, annotation_id, REQUEST):
"""Suppression annotation.
"""
"""Suppression annotation."""
if not self.canSuppressAnnotation(annotation_id, REQUEST):
raise AccessDenied("Vous n'avez pas le droit d'effectuer cette opération !")
@ -1318,7 +1315,7 @@ function tweakmenu( gname ) {
security.declareProtected(ScoView, "etud_photo_html")
etud_photo_html = sco_photos.etud_photo_html
security.declareProtected(ScoView, "etud_photo_orig_page")
def etud_photo_orig_page(self, etudid=None, REQUEST=None):
@ -1337,8 +1334,7 @@ function tweakmenu( gname ) {
security.declareProtected(ScoEtudChangeAdr, "formChangePhoto")
def formChangePhoto(self, etudid=None, REQUEST=None):
"""Formulaire changement photo étudiant
"""
"""Formulaire changement photo étudiant"""
etud = self.getEtudInfo(filled=1, REQUEST=REQUEST)[0]
if sco_photos.etud_photo_is_local(self, etud):
etud["photoloc"] = "dans ScoDoc"
@ -1396,8 +1392,7 @@ function tweakmenu( gname ) {
security.declareProtected(ScoEtudChangeAdr, "formSuppressPhoto")
def formSuppressPhoto(self, etudid=None, REQUEST=None, dialog_confirmed=False):
"""Formulaire suppression photo étudiant
"""
"""Formulaire suppression photo étudiant"""
etud = self.getEtudInfo(filled=1, REQUEST=REQUEST)[0]
if not dialog_confirmed:
return self.confirmDialog(
@ -2599,7 +2594,7 @@ Les champs avec un astérisque (*) doivent être présents (nulls non autorisés
return "\n".join(H) + self.sco_footer(REQUEST)
security.declareProtected(ScoEtudInscrit, "formsemestre_import_etud_admission")
security.declareProtected(ScoEtudChangeAdr, "formsemestre_import_etud_admission")
def formsemestre_import_etud_admission(
self, formsemestre_id, import_email=True, REQUEST=None
@ -2818,8 +2813,7 @@ def manage_addZScolarForm(context, DeptId, REQUEST=None):
def _simple_error_page(context, msg, DeptId=None):
"""Minimal error page (used by installer only).
"""
"""Minimal error page (used by installer only)."""
H = [context.standard_html_header(context), "<h2>Erreur !</h2>", "<p>", msg, "</p>"]
if DeptId:
H.append(

View File

@ -190,7 +190,7 @@ class BaseArchiver:
return archive_id
def store(self, archive_id, filename, data):
"""Store data in archive, under given filename.
"""Store data in archive, under given filename.
Filename may be modified (sanitized): return used filename
The file is created or replaced.
"""
@ -216,8 +216,7 @@ class BaseArchiver:
return open(fname).read()
def get_archived_file(self, context, REQUEST, oid, archive_name, filename):
"""Recupere donnees du fichier indiqué et envoie au client
"""
"""Recupere donnees du fichier indiqué et envoie au client"""
# XXX très incomplet: devrait inférer et assigner un type MIME
archive_id = self.get_id_from_name(context, oid, archive_name)
data = self.get(archive_id, filename)
@ -260,6 +259,7 @@ def do_formsemestre_archive(
numeroArrete=None,
VDICode=None,
showTitle=False,
with_paragraph_nom=False,
anonymous=False,
bulVersion="long",
):
@ -348,6 +348,7 @@ def do_formsemestre_archive(
numeroArrete=numeroArrete,
VDICode=VDICode,
showTitle=showTitle,
with_paragraph_nom=with_paragraph_nom,
anonymous=anonymous,
)
if data:
@ -467,6 +468,7 @@ enregistrés et non modifiables, on peut les retrouver ultérieurement.
numeroArrete=tf[2]["numeroArrete"],
VDICode=tf[2]["VDICode"],
showTitle=tf[2]["showTitle"],
with_paragraph_nom=tf[2]["with_paragraph_nom"],
anonymous=tf[2]["anonymous"],
bulVersion=tf[2]["bulVersion"],
)
@ -480,8 +482,7 @@ enregistrés et non modifiables, on peut les retrouver ultérieurement.
def formsemestre_list_archives(context, REQUEST, formsemestre_id):
"""Page listing archives
"""
"""Page listing archives"""
L = []
for archive_id in PVArchive.list_obj_archives(context, formsemestre_id):
a = {
@ -525,8 +526,7 @@ def formsemestre_list_archives(context, REQUEST, formsemestre_id):
def formsemestre_get_archived_file(
context, REQUEST, formsemestre_id, archive_name, filename
):
"""Send file to client.
"""
"""Send file to client."""
return PVArchive.get_archived_file(
context, REQUEST, formsemestre_id, archive_name, filename
)
@ -535,8 +535,7 @@ def formsemestre_get_archived_file(
def formsemestre_delete_archive(
context, REQUEST, formsemestre_id, archive_name, dialog_confirmed=False
):
"""Delete an archive
"""
"""Delete an archive"""
if not context._can_edit_pv(REQUEST, formsemestre_id):
raise AccessDenied(
"opération non autorisée pour %s" % str(REQUEST.AUTHENTICATED_USER)

View File

@ -77,7 +77,12 @@ def makeMenu(title, items, css_class="", base_url="", alone=False):
item["urlq"] = item.get("url", "#")
item["attr"] = item.get("attr", "")
submenu = item.get("submenu", None)
H.append("<li " + li_id + cls + '><a href="%(urlq)s" %(attr)s>%(title)s</a>' % item)
H.append(
"<li "
+ li_id
+ cls
+ '><a href="%(urlq)s" %(attr)s>%(title)s</a>' % item
)
if submenu:
gen_menu_items(submenu)
H.append("</li>")
@ -326,7 +331,7 @@ def formsemestre_status_menubar(context, sem, REQUEST):
"title": "Resynchroniser données identité",
"url": "formsemestre_import_etud_admission?formsemestre_id="
+ formsemestre_id,
"enabled": authuser.has_permission(ScoEtudInscrit, context)
"enabled": authuser.has_permission(ScoEtudChangeAdr, context)
and context.get_preference("portal_url"),
},
{
@ -463,7 +468,7 @@ def formsemestre_status_menubar(context, sem, REQUEST):
def retreive_formsemestre_from_request(context, REQUEST):
"""Cherche si on a de quoi déduire le semestre affiché à partir des
arguments de la requête:
arguments de la requête:
formsemestre_id ou moduleimpl ou evaluation ou group_id ou partition_id
"""
# Search formsemestre
@ -539,8 +544,7 @@ def formsemestre_page_title(context, REQUEST):
def fill_formsemestre(context, sem, REQUEST=None):
"""Add some useful fields to help display formsemestres
"""
"""Add some useful fields to help display formsemestres"""
# Notes URL
notes_url = context.absolute_url()
if "/Notes" not in notes_url:
@ -548,13 +552,12 @@ def fill_formsemestre(context, sem, REQUEST=None):
sem["notes_url"] = notes_url
formsemestre_id = sem["formsemestre_id"]
if sem["etat"] != "1":
sem["locklink"] = (
"""<a href="%s/formsemestre_change_lock?formsemestre_id=%s">%s</a>"""
% (
notes_url,
sem["formsemestre_id"],
icontag("lock_img", border="0", title="Semestre verrouillé"),
)
sem[
"locklink"
] = """<a href="%s/formsemestre_change_lock?formsemestre_id=%s">%s</a>""" % (
notes_url,
sem["formsemestre_id"],
icontag("lock_img", border="0", title="Semestre verrouillé"),
)
else:
sem["locklink"] = ""
@ -795,8 +798,7 @@ def html_expr_diagnostic(context, diagnostics):
def formsemestre_status_head(
context, formsemestre_id=None, REQUEST=None, page_title=None
):
"""En-tête HTML des pages "semestre"
"""
"""En-tête HTML des pages "semestre" """
semlist = sco_formsemestre.do_formsemestre_list(
context, args={"formsemestre_id": formsemestre_id}
)