forked from ScoDoc/ScoDoc
Assiduites : bugfix external_data + differee
This commit is contained in:
parent
4a877212c7
commit
466dbe4859
@ -372,7 +372,9 @@ def assiduites_formsemestre(formsemestre_id: int, with_query: bool = False):
|
||||
if formsemestre is None:
|
||||
return json_error(404, "le paramètre 'formsemestre_id' n'existe pas")
|
||||
|
||||
assiduites_query = scass.filter_by_formsemestre(Assiduite.query,Assiduite, formsemestre)
|
||||
assiduites_query = scass.filter_by_formsemestre(
|
||||
Assiduite.query, Assiduite, formsemestre
|
||||
)
|
||||
|
||||
if with_query:
|
||||
assiduites_query = _filter_manager(request, assiduites_query)
|
||||
@ -597,8 +599,8 @@ def _create_singular(
|
||||
|
||||
desc: str = data.get("desc", None)
|
||||
|
||||
external_data = data.get("external_data", False)
|
||||
if external_data is not False:
|
||||
external_data = data.get("external_data", None)
|
||||
if external_data is not None:
|
||||
if not isinstance(external_data, dict):
|
||||
errors.append("param 'external_data' : n'est pas un objet JSON")
|
||||
|
||||
|
@ -1411,7 +1411,10 @@ function getModuleImplId() {
|
||||
function setModuleImplId(assiduite, module = null) {
|
||||
const moduleimpl = module == null ? getModuleImplId() : module;
|
||||
if (moduleimpl === "autre") {
|
||||
if ("external_data" in assiduite && assiduite.external_data != undefined) {
|
||||
if (
|
||||
"external_data" in assiduite &&
|
||||
assiduite.external_data instanceof Object
|
||||
) {
|
||||
if ("module" in assiduite.external_data) {
|
||||
assiduite.external_data.module = "Autre";
|
||||
} else {
|
||||
@ -1423,7 +1426,10 @@ function setModuleImplId(assiduite, module = null) {
|
||||
assiduite.moduleimpl_id = null;
|
||||
} else {
|
||||
assiduite["moduleimpl_id"] = moduleimpl;
|
||||
if ("external_data" in assiduite && assiduite.external_data != undefined) {
|
||||
if (
|
||||
"external_data" in assiduite &&
|
||||
assiduite.external_data instanceof Object
|
||||
) {
|
||||
if ("module" in assiduite.external_data) {
|
||||
delete assiduite.external_data.module;
|
||||
}
|
||||
|
@ -680,7 +680,7 @@
|
||||
rbtn.parentElement.setAttribute('etat', etat);
|
||||
asyncCreateAssiduite(assiduite, (data) => {
|
||||
if (Object.keys(data.success).length > 0) {
|
||||
const assi_id = data.success['0'].assiduite_id;
|
||||
const assi_id = data.success['0'].message.assiduite_id;
|
||||
etudLine.setAttribute('assiduite_id', assi_id);
|
||||
assiduite["assiduite_id"] = assi_id;
|
||||
assiduites[etudid].push(assiduite);
|
||||
|
@ -269,6 +269,11 @@ def test_route_create(api_admin_headers):
|
||||
assert len(res["success"]) == 1
|
||||
|
||||
TO_REMOVE.append(res["success"][0]["message"]["assiduite_id"])
|
||||
data = GET(
|
||||
path=f'/assiduite/{res["success"][0]["message"]["assiduite_id"]}',
|
||||
headers=api_admin_headers,
|
||||
)
|
||||
check_fields(data)
|
||||
|
||||
data2 = create_data("absent", "02", MODULE, "desc")
|
||||
res = POST_JSON(f"/assiduite/{ETUDID}/create", [data2], api_admin_headers)
|
||||
|
Loading…
Reference in New Issue
Block a user