1
0
forked from ScoDoc/ScoDoc

More debug info (save_note : mystère)

This commit is contained in:
Emmanuel Viennet 2023-05-31 12:25:40 +02:00
parent 63cf7dfc42
commit 5f0ac236d7
4 changed files with 8 additions and 3 deletions

View File

@ -56,7 +56,7 @@ class NotesNotes(db.Model):
"pour debug" "pour debug"
from app.models.evaluations import Evaluation from app.models.evaluations import Evaluation
return f"""<{self.__class__.__name__} {self.id} v={self.value} {self.date.isoformat() return f"""<{self.__class__.__name__} {self.id} etudid={self.etudid} v={self.value} {self.date.isoformat()
} {Evaluation.query.get(self.evaluation_id) if self.evaluation_id else "X" }>""" } {Evaluation.query.get(self.evaluation_id) if self.evaluation_id else "X" }>"""

View File

@ -583,8 +583,12 @@ def notes_add(
existing_note = NotesNotes.query.filter_by( existing_note = NotesNotes.query.filter_by(
evaluation_id=evaluation_id, etudid=etudid evaluation_id=evaluation_id, etudid=etudid
).first() ).first()
sco_cache.EvaluationCache.delete(evaluation_id)
notes_db = sco_evaluation_db.do_evaluation_get_all_notes(
evaluation_id
)
raise ScoBugCatcher( raise ScoBugCatcher(
f"dup: existing={existing_note} value={value}" f"dup: existing={existing_note} etudid={repr(etudid)} value={value} in_db={etudid in notes_db}"
) from exc ) from exc
changed = True changed = True
else: else:

View File

@ -51,6 +51,7 @@ function save_note(elem, v, etudid) {
'comment': document.getElementById('formnotes_comment').value 'comment': document.getElementById('formnotes_comment').value
}, },
function (result) { function (result) {
$('#sco_msg').hide();
if (result['nbchanged'] > 0) { if (result['nbchanged'] > 0) {
sco_message("enregistré"); sco_message("enregistré");
elem.className = "note_saved"; elem.className = "note_saved";

View File

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