1
0
forked from ScoDoc/ScoDoc
This commit is contained in:
Emmanuel Viennet 2021-09-13 17:10:38 +02:00
parent 2cfdeb58e5
commit d86a2dfc65
7 changed files with 21 additions and 7 deletions

View File

@ -95,7 +95,7 @@ def reset_password_request():
current_app.logger.info( current_app.logger.info(
"reset_password_request: for unkown user '{}'".format(form.email.data) "reset_password_request: for unkown user '{}'".format(form.email.data)
) )
flash(_("Voir les instructions enoyez par mail")) flash(_("Voir les instructions envoyées par mail"))
return redirect(url_for("auth.login")) return redirect(url_for("auth.login"))
return render_template( return render_template(
"auth/reset_password_request.html", title=_("Reset Password"), form=form "auth/reset_password_request.html", title=_("Reset Password"), form=form

View File

@ -444,7 +444,10 @@ def _ue_mod_bulletin(etudid, formsemestre_id, ue_id, modimpls, nt, version):
if mod["mod_moy_txt"][:2] == "NA": if mod["mod_moy_txt"][:2] == "NA":
mod["mod_moy_txt"] = "-" mod["mod_moy_txt"] = "-"
if is_malus: if is_malus:
if mod_moy > 0: if isinstance(mod_moy, str):
mod["mod_moy_txt"] = "-"
mod["mod_coef_txt"] = "-"
elif mod_moy > 0:
mod["mod_moy_txt"] = scu.fmt_note(mod_moy) mod["mod_moy_txt"] = scu.fmt_note(mod_moy)
mod["mod_coef_txt"] = "Malus" mod["mod_coef_txt"] = "Malus"
elif mod_moy < 0: elif mod_moy < 0:

View File

@ -440,7 +440,7 @@ def notify_etud_change(email_addr, etud, before, after, subject):
"Civilité: " + etud["civilite_str"], "Civilité: " + etud["civilite_str"],
"Nom: " + etud["nom"], "Nom: " + etud["nom"],
"Prénom: " + etud["prenom"], "Prénom: " + etud["prenom"],
"Etudid: " + etud["etudid"], "Etudid: " + str(etud["etudid"]),
"\n", "\n",
"Changements effectués:", "Changements effectués:",
] ]

View File

@ -27,6 +27,7 @@
"""Operations de base sur les formsemestres """Operations de base sur les formsemestres
""" """
from app.scodoc.sco_exceptions import ScoValueError
import time import time
from operator import itemgetter from operator import itemgetter
@ -93,6 +94,10 @@ _formsemestreEditor = ndb.EditableTable(
def get_formsemestre(formsemestre_id): def get_formsemestre(formsemestre_id):
"list ONE formsemestre" "list ONE formsemestre"
if not isinstance(formsemestre_id, int):
raise ScoValueError(
"""Semestre invalide, reprenez l'opération au départ ou si le problème persiste signalez l'erreur sur scodoc-devel@listes.univ-paris13.fr"""
)
try: try:
sem = do_formsemestre_list(args={"formsemestre_id": formsemestre_id})[0] sem = do_formsemestre_list(args={"formsemestre_id": formsemestre_id})[0]
return sem return sem

View File

@ -45,13 +45,20 @@ class Permission(object):
NBITS = 1 # maximum bits used (for formatting) NBITS = 1 # maximum bits used (for formatting)
ALL_PERMISSIONS = [-1] ALL_PERMISSIONS = [-1]
description = {} # { symbol : blah blah } description = {} # { symbol : blah blah }
permission_by_name = {} # { symbol : int }
@staticmethod @staticmethod
def init_permissions(): def init_permissions():
for (perm, symbol, description) in _SCO_PERMISSIONS: for (perm, symbol, description) in _SCO_PERMISSIONS:
setattr(Permission, symbol, perm) setattr(Permission, symbol, perm)
Permission.description[symbol] = description Permission.description[symbol] = description
Permission.permission_by_name[symbol] = perm
Permission.NBITS = len(_SCO_PERMISSIONS) Permission.NBITS = len(_SCO_PERMISSIONS)
@staticmethod
def get_by_name(permission_name: str) -> int:
"""Return permission mode (integer bit field). May raise keyError."""
return Permission.permission_by_name[permission_name]
Permission.init_permissions() Permission.init_permissions()

View File

@ -537,10 +537,9 @@ def sendXML(REQUEST, data, tagname=None, force_outer_xml_tag=True):
if type(data) != list: if type(data) != list:
data = [data] # always list-of-dicts data = [data] # always list-of-dicts
if force_outer_xml_tag: if force_outer_xml_tag:
root_tagname = tagname + "_list" data = [{tagname: data}]
data = [{root_tagname: data}] tagname += "_list"
doc = sco_xml.simple_dictlist2xml(data, tagname=tagname) doc = sco_xml.simple_dictlist2xml(data, tagname=tagname)
if REQUEST: if REQUEST:
REQUEST.RESPONSE.setHeader("content-type", XML_MIMETYPE) REQUEST.RESPONSE.setHeader("content-type", XML_MIMETYPE)
return doc return doc

View File

@ -1,7 +1,7 @@
# -*- mode: python -*- # -*- mode: python -*-
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
SCOVERSION = "9.0.19" SCOVERSION = "9.0.21"
SCONAME = "ScoDoc" SCONAME = "ScoDoc"