Bug task without id
This commit is contained in:
12
app.py
12
app.py
@@ -192,8 +192,16 @@ def construire_contexte_memoire(session_id=None):
|
|||||||
if contexte.get("last_project"):
|
if contexte.get("last_project"):
|
||||||
lignes.append(f"- dernier projet mentionne : {contexte['last_project']}")
|
lignes.append(f"- dernier projet mentionne : {contexte['last_project']}")
|
||||||
if contexte.get("tasks"):
|
if contexte.get("tasks"):
|
||||||
ids = ", ".join(f"#{tache['id']} {tache['title']}" for tache in contexte["tasks"][:5])
|
taches_affichees = []
|
||||||
lignes.append(f"- dernieres taches affichees : {ids}")
|
for tache in contexte["tasks"][:5]:
|
||||||
|
titre = tache.get("title") or tache.get("titre") or tache.get("task_title") or tache.get("tache")
|
||||||
|
identifiant = tache.get("id")
|
||||||
|
if titre and identifiant is not None:
|
||||||
|
taches_affichees.append(f"#{identifiant} {titre}")
|
||||||
|
elif titre:
|
||||||
|
taches_affichees.append(str(titre))
|
||||||
|
if taches_affichees:
|
||||||
|
lignes.append(f"- dernieres taches affichees : {', '.join(taches_affichees)}")
|
||||||
|
|
||||||
lignes.append(
|
lignes.append(
|
||||||
"Utilise ce contexte pour repondre aux questions globales. "
|
"Utilise ce contexte pour repondre aux questions globales. "
|
||||||
|
|||||||
Reference in New Issue
Block a user