Project

General

Profile

Bug #6612

formulaire rendu inaccessible si le workflow correspondant a été effacé

Added by Thomas Noël about 8 years ago. Updated about 8 years ago.

Status:
Nouveau
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
04 March 2015
Due date:
% Done:

0%

Estimated time:
Patch proposed:
No
Planning:

Description

Cette bête trace obtenue suite à la suppression d'un workflow, alors qu'il était utilisé par un formulaire. Quand on va sur le formulaire, boum, crash.

(Sans doute une vérification à faire pour autoriser la suppression d'un workflow)

Exception:
  type = '<type 'exceptions.KeyError'>', value = ''

Stack trace (most recent call first):
  File "/usr/lib/python2.7/dist-packages/wcs/qommon/storage.py", line 333, in get_filename
   331             if ignore_errors:
   332                 return None
>  333             raise KeyError()
   334         except (EOFError, ImportError), e:
   335             if ignore_errors:

  locals:
     ignore_errors = False
     ignore_migration = False
     cls = <class 'wcs.workflows.Workflow'>
     filename = '/var/lib/wcs-au-quotidien/vincennes.dev.au-quotidien.com/workflows/11'

History

#1

Updated by Frédéric Péters about 8 years ago

Le bout de la trace qui m'intéresse :

  File "/usr/lib/python2.7/dist-packages/wcs/admin/forms.py", line 263, in _q_index
   261                 r += '-'
   262             if self.formdef.workflow_id:
>  263                 pristine_workflow = Workflow.get(self.formdef.workflow_id)
   264                 if pristine_workflow.variables_formdef:
   265                     r += htmltext(' (<a rel="popup" href="workflow-variables">%s</a>)') % _('options')
#2

Updated by Frédéric Péters about 8 years ago

Étrangement, sur une situation où je voulais supprimer un workflow, j'ai eu un message "This workflow is currently in use, you cannot remove it."

#3

Updated by Thomas Noël about 8 years ago

Effectivement,

        for formdef in FormDef.select():
            if formdef.workflow_id == self.workflow.id:
                form.widgets.append(HtmlWidget('<p>%s</p>' % _(
                        "This workflow is currently in use, you cannot remove it.")))

... donc je ne comprends pas trop comment le workflow a pu disparaître. (la disparition a eu lieu sur la prod, la dev était une copie de la prod... sur laquelle le problème existe toujours, peut-être depuis longtemps, https://demarches.vincennes.fr/admin/forms/76/ )

Also available in: Atom PDF