forked from ScoDoc/ScoDoc
Merge branch 'dev96' of https://scodoc.org/git/iziram/ScoDoc into sco96
This commit is contained in:
commit
2d1cdabdbf
@ -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")
|
||||
|
||||
|
@ -885,7 +885,7 @@ function createAssiduite(etat, etudid) {
|
||||
(data, status) => {
|
||||
//success
|
||||
if (data.success.length > 0) {
|
||||
let obj = data.success["0"].assiduite_id;
|
||||
let obj = data.success["0"].message.assiduite_id;
|
||||
}
|
||||
},
|
||||
(data, status) => {
|
||||
@ -910,7 +910,7 @@ function deleteAssiduite(assiduite_id) {
|
||||
(data, status) => {
|
||||
//success
|
||||
if (data.success.length > 0) {
|
||||
let obj = data.success["0"].assiduite_id;
|
||||
let obj = data.success["0"].message.assiduite_id;
|
||||
}
|
||||
},
|
||||
(data, status) => {
|
||||
@ -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;
|
||||
}
|
||||
|
@ -164,7 +164,7 @@
|
||||
dateType: 'json',
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: () => { },
|
||||
success: () => { console.log("done") },
|
||||
}
|
||||
)
|
||||
)
|
||||
@ -192,8 +192,8 @@
|
||||
errorAlert();
|
||||
}
|
||||
if (Object.keys(data.success).length > 0) {
|
||||
couverture = data.success[0].couverture
|
||||
justif_id = data.success[0].justif_id;
|
||||
couverture = data.success[0].message.couverture
|
||||
justif_id = data.success[0].message.justif_id;
|
||||
importFiles(justif_id);
|
||||
return;
|
||||
}
|
||||
|
@ -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);
|
||||
@ -917,7 +917,7 @@
|
||||
).done((c, e) => {
|
||||
Object.keys(c[0].success).forEach((k) => {
|
||||
const assiduite = createList[Number.parseInt(k)];
|
||||
assiduite["assiduite_id"] = c[0].success[k].assiduite_id;
|
||||
assiduite["assiduite_id"] = c[0].success[k].message.assiduite_id;
|
||||
assiduites[assiduite.etudid].push(assiduite);
|
||||
})
|
||||
Object.keys(e[0].success).forEach((k) => {
|
||||
|
@ -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