Projet

Général

Profil

Development #76909

api & applification: lors de l'import d'un formulaire et workflow avec donnée de traitement il manque un rebuild de la table formdef

Ajouté par Lauréline Guérin il y a environ un an. Mis à jour il y a 6 mois.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
Début:
24 avril 2023
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Non
Planning:
Non

Description

diff --git a/tests/api/test_export_import.py b/tests/api/test_export_import.py
index 23cd986a4..a0a5b54a3 100644
--- a/tests/api/test_export_import.py
+++ b/tests/api/test_export_import.py
@@ -578,6 +578,10 @@ def test_export_import_bundle_import(pub):
     workflow = Workflow(name='test')
     workflow.roles = {'_receiver': 'Receiver'}
     workflow.category = workflow_category
+    workflow.backoffice_fields_formdef = WorkflowBackofficeFieldsFormDef(workflow)
+    workflow.backoffice_fields_formdef.fields = [
+        StringField(id='bo1', label='test', type='string'),
+    ]
     workflow.store()

     block_category = BlockCategory(name='test')
@@ -745,6 +749,9 @@ def test_export_import_bundle_import(pub):
     assert application.visible is True
     assert ApplicationElement.count() == 15

+    formdef = FormDef.select()[0]
+    assert formdef.data_class().select()  # check that fbo1 field exists in DB
+
     # check editable flag is kept on install
     application.editable = False
     application.store()

=> FAILED tests/api/test_export_import.py::test_export_import_bundle_import - psycopg2.errors.UndefinedColumn: ERREUR: la colonne « fbo1 » n'existe pas

Dans le store du workflow:

        if not migration_update:
            if get_response():  # <- on passe là
                get_response().add_after_job(_('Reindexing cards and forms after workflow change'), update)  # update fait un formdef.update_storage()
            else:
                update()

On est déjà dans un afterjob (BundleImportJob), qui appelle un autre afterjob.

Révisions associées

Révision 52250e92 (diff)
Ajouté par Frédéric Péters il y a 6 mois

misc: add afterjob processing to native django views (#76909)

Révision 92f90075 (diff)
Ajouté par Frédéric Péters il y a 6 mois

api: run afterjobs after application pre-imports (#76909)

Historique

#2

Mis à jour par Frédéric Péters il y a 6 mois

  • Assigné à mis à Frédéric Péters
#3

Mis à jour par Robot Gitea il y a 6 mois

  • Statut changé de Nouveau à En cours

Frédéric Péters (fpeters) a ouvert une pull request sur Gitea concernant cette demande :

#4

Mis à jour par Robot Gitea il y a 6 mois

  • Statut changé de En cours à Solution proposée
#5

Mis à jour par Robot Gitea il y a 6 mois

  • Statut changé de Solution proposée à Solution validée

Lauréline Guérin (lguerin) a approuvé une pull request sur Gitea concernant cette demande :

#6

Mis à jour par Robot Gitea il y a 6 mois

  • Statut changé de Solution validée à Résolu (à déployer)

Frédéric Péters (fpeters) a mergé une pull request sur Gitea concernant cette demande :

#7

Mis à jour par Transition automatique il y a 6 mois

  • Statut changé de Résolu (à déployer) à Solution déployée
#8

Mis à jour par Transition automatique il y a 4 mois

Automatic expiration

Formats disponibles : Atom PDF