Petits correctifs suite à migration iutv

This commit is contained in:
Emmanuel Viennet 2021-09-11 19:05:19 +02:00
parent badf83cc7f
commit 4bb79e6853
3 changed files with 30 additions and 1 deletions

View File

@ -225,7 +225,7 @@ def search_etuds_infos(expnom=None, code_nip=None):
else:
code_nip = code_nip or expnom
if code_nip:
etuds = sco_etud.etudident_list(cnx, args={"code_nip": code_nip})
etuds = sco_etud.etudident_list(cnx, args={"code_nip": str(code_nip)})
else:
etuds = []
sco_etud.fill_etuds_info(etuds)

View File

@ -37,6 +37,7 @@ import flask
from flask import abort, flash, url_for, redirect, render_template, send_file
from flask import request
from flask.app import Flask
import flask_login
from flask_login.utils import login_required
from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileAllowed
@ -57,6 +58,7 @@ from app.scodoc import sco_utils as scu
from app.decorators import (
admin_required,
scodoc7func,
scodoc,
permission_required_compat_scodoc7,
)
from app.scodoc.sco_permissions import Permission
@ -131,6 +133,31 @@ def get_etud_dept():
return Departement.query.get(last_etud.dept_id).acronym
# Bricolage pour le portail IUTV avec ScoDoc 7: (DEPRECATED: NE PAS UTILISER !)
@bp.route(
"/ScoDoc/search_inscr_etud_by_nip", methods=["GET"]
) # pour compat anciens clients PHP
@scodoc
@scodoc7func
def search_inscr_etud_by_nip(
code_nip, REQUEST=None, format="json", __ac_name="", __ac_password=""
):
auth_ok = False
user_name = __ac_name
user_password = __ac_password
if user_name and user_password:
u = User.query.filter_by(user_name=user_name).first()
if u and u.check_password(user_password):
auth_ok = True
flask_login.login_user(u)
if not auth_ok:
abort(403)
else:
return sco_find_etud.search_inscr_etud_by_nip(
code_nip=code_nip, REQUEST=REQUEST, format=format
)
@bp.route("/ScoDoc/about")
@bp.route("/ScoDoc/Scolarite/<scodoc_dept>/about")
def about(scodoc_dept=None):

View File

@ -381,6 +381,8 @@ def convert_object(
"absences_notifications",
"itemsuivi", # etudid n'était pas une clé
"adresse", # etudid n'était pas une clé
"admissions", # idem
"scolar_events",
}:
# tables avec "fausses" clés
# (l'object référencé a pu disparaitre)