Project

General

Profile

Bug #41809

crash sur formulaire qui référence un modèle de fiche inexistant

Added by Frédéric Péters 3 months ago.

Status:
Nouveau
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
17 Apr 2020
Due date:
% Done:

0%

Patch proposed:
No
Planning:
No

Description

Exception:
  type = '<class 'KeyError'>', value = ''

Stack trace (most recent call first):
  File "/usr/lib/python3/dist-packages/wcs/qommon/storage.py", line 469, in get_filename
   467             if ignore_errors:
   468                 return None
>  469             raise KeyError()
   470         except ImportError as e:
   471             if ignore_errors:

  locals:
     cls = <class 'wcs.carddef.CardDef'>
     filename = '/var/lib/wcs/demarches-metz.test.entrouvert.org/carddefs-url_name/liste-des-classes-scolaires'
     ignore_errors = False
     ignore_migration = False
     kwargs = {}

  File "/usr/lib/python3/dist-packages/wcs/qommon/storage.py", line 426, in get_on_index
   424         filename = os.path.join(index_dir, str(fix_key(id)))
   425         return cls.get_filename(filename, ignore_errors=ignore_errors,
>  426                 ignore_migration=ignore_migration)
   427
   428     @classmethod

  locals:
     cls = <class 'wcs.carddef.CardDef'>
     filename = '/var/lib/wcs/demarches-metz.test.entrouvert.org/carddefs-url_name/liste-des-classes-scolaires'
     id = 'liste-des-classes-scolaires'
     ignore_errors = False
     ignore_migration = False
     index = 'url_name'
     index_dir = '/var/lib/wcs/demarches-metz.test.entrouvert.org/carddefs-url_name'
     objects_dir = '/var/lib/wcs/demarches-metz.test.entrouvert.org/carddefs'

  File "/usr/lib/python3/dist-packages/wcs/formdef.py", line 521, in get_by_urlname
   519     @classmethod
   520     def get_by_urlname(cls, url_name, ignore_migration=False):
>  521         return cls.get_on_index(url_name, 'url_name', ignore_migration=ignore_migration)
   522
   523     def get_url(self, backoffice=False, preview=False):

  locals:
     cls = <class 'wcs.carddef.CardDef'>
     ignore_migration = False
     url_name = 'liste-des-classes-scolaires'

  File "/usr/lib/python3/dist-packages/wcs/data_sources.py", line 152, in get_structured_items
   150         # cards
   151         from wcs.carddef import CardDef
>  152         carddef = CardDef.get_by_urlname(data_source['type'][8:])
   153         items = [x.get_data_source_structured_item()
   154                  for x in carddef.data_class().select()

  locals:
     CardDef = <class 'wcs.carddef.CardDef'>
     cache_duration = 0
     data_source = {'type': 'carddef:liste-des-classes-scolaires'}
     mode = None

  File "/usr/lib/python3/dist-packages/wcs/data_sources.py", line 107, in get_items
   105
   106 def get_items(data_source, include_disabled=False, mode=None):
>  107     structured_items = get_structured_items(data_source, mode=mode)
   108     tupled_items = []
   109     for item in structured_items:

  locals:
     data_source = {'type': 'carddef:liste-des-classes-scolaires'}
     include_disabled = False
     mode = None

  File "/usr/lib/python3/dist-packages/wcs/fields.py", line 1461, in perform_more_widget_changes
  1459         elif self.data_source:
  1460             items = data_sources.get_items(self.data_source,
> 1461                     include_disabled=self.display_disabled_items)
  1462             kwargs['options'] = [x[:3] for x in items if not x[-1].get('disabled')]
  1463             kwargs['options_with_attributes'] = items[:]

  locals:
     data_source = <NamedDataSource None id:None>
     display_mode = 'list'
     edit = True
     form = <wcs.qommon.form.Form object at 0x7f983c0c8b70>
     kwargs = {'required': True}
     self = <ItemField 37 'Classe'>

  File "/usr/lib/python3/dist-packages/wcs/fields.py", line 505, in add_to_form
   503             if hasattr(self, k):
   504                 kwargs[k] = getattr(self, k)
>  505         self.perform_more_widget_changes(form, kwargs)
   506         if self.hint and self.hint.startswith('<'):
   507             hint = htmltext(self.hint)

  locals:
     form = <wcs.qommon.form.Form object at 0x7f983c0c8b70>
     kwargs = {'required': True}
     self = <ItemField 37 'Classe'>
...

Related issues

Related to w.c.s. - Bug #42579: vérifier à l'import la présence des modèles de fiche dont dépend un formulaire Solution déployée 06 May 2020

History

#2 Updated by Frédéric Péters about 1 month ago

  • Related to Bug #42579: vérifier à l'import la présence des modèles de fiche dont dépend un formulaire added

Also available in: Atom PDF