Development #75793
action "Modification d'une fiche", n'enregistrer une evo que s'il y a eu un changement
Début:
24 mars 2023
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Non
Planning:
Non
Description
Actuellement on ajoute toujours une evol, mais sur statut qui boucle sur lui-même ça crée beaucoup trop d'evolutions vides.
Le code:
with get_publisher().substitutions.freeze(): # record a workflow event with a link to current workflow & action target_data.record_workflow_event( 'workflow-edited', external_workflow_id=self.parent.parent.id, external_status_id=self.parent.id, external_item_id=self.id, ) evo = Evolution() evo.time = time.localtime() evo.status = target_data.status target_data.evolution.append(evo) ContentSnapshotPart.take(formdata=target_data, old_data=old_data) target_data.store()
Faire un peu comme dans la méthode jump_status
de FormData
?
elif ( self.status == status and self.evolution[-1].status == status and not self.evolution[-1].comment and not [x for x in self.evolution[-1].parts or [] if not isinstance(x, ContentSnapshotPart)] ): # if status do not change and last evolution is empty, # just update last jump time on last evolution, do not add one self.evolution[-1].last_jump_datetime = datetime.datetime.now() self.store() return
=> si old_data==new_data et que la dernière évol ne contient pas de commentaire et pas autre chose qu'un snapshot, ne rien faire ?
Révisions associées
Historique
Mis à jour par Robot Gitea il y a environ un an
- Statut changé de Nouveau à En cours
- Assigné à mis à Lauréline Guérin
Lauréline Guérin (lguerin) a ouvert une pull request sur Gitea concernant cette demande :
- URL : https://git.entrouvert.org/entrouvert/wcs/pulls/219
- Titre : WIP: workflows: do not add evolution in edit carddata action if no changes (#75793)
- Modifications : https://git.entrouvert.org/entrouvert/wcs/pulls/219/files
Mis à jour par Pierre Cros il y a environ un an
- Sujet changé de action "édition d'une fiche", n'enregistrer une evo que s'il y a eu un changement à action "Modification d'une fiche", n'enregistrer une evo que s'il y a eu un changement
Mis à jour par Robot Gitea il y a environ un an
- Statut changé de Solution proposée à Solution validée
Serghei Mihai (smihai) a approuvé une pull request sur Gitea concernant cette demande :
Mis à jour par Robot Gitea il y a environ un an
- Statut changé de Solution validée à Résolu (à déployer)
Lauréline Guérin (lguerin) a mergé une pull request sur Gitea concernant cette demande :
- URL : https://git.entrouvert.org/entrouvert/wcs/pulls/219
- Titre : workflows: do not add evolution in edit carddata action if no changes (#75793)
- Modifications : https://git.entrouvert.org/entrouvert/wcs/pulls/219/files
Mis à jour par Transition automatique il y a environ un an
- Statut changé de Résolu (à déployer) à Solution déployée
workflows: do not add evolution in edit carddata action if no changes (#75793)