Project

General

Profile

Bug #57726

live et bloc de champ et sequence item 0: expected str instance, NoneType found

Added by Frédéric Péters about 2 months ago. Updated about 2 months ago.

Status:
Nouveau
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
11 Oct 2021
Due date:
% Done:

0%

Estimated time:
Patch proposed:
No
Planning:
No

Description

Exception:
  type = '<class 'TypeError'>', value = 'sequence item 0: expected str instance, NoneType found'

Stack trace (most recent call first):
  File "/usr/lib/python3/dist-packages/wcs/fields.py", line 3344, in store_display_value
  3342             for subvalue in value.get('data'):
  3343                 parts.append(self.block.get_display_value(subvalue))
> 3344         return ', '.join(parts)
  3345 
  3346     def get_view_value(self, value, summary=False, **kwargs):

  locals: 
     data = {'15': {'data': [{'bf5c120215-c39f-43b6-9e2c-cf52f464122b': '11', 'bfe0710a21-7381-4518-a0bb-2024d6ef9761': None, 'bf486245af-bb5a-4d92-93eb-4a564620366c': 'rue de la rue', 'bf4134033e-4ce1-488f-b4f6-fea723ee703e': '59000', 'bf3b364cb9-ee9d-4289-8380-0f7bc29ce332': 'Lille', 'bfc13f7eed-6f53-4b41-b0d2-60b7d032530d': None}], 'schema': {'bf5c120215-c39f-43b6-9e2c-cf52f464122b': 'string', 'bfe0710a21-7381-4518-a0bb-2024d6ef9761': 'string', 'bf486245af-bb5a-4d92-93eb-4a564620366c': 'string', 'bf4134033e-4ce1-488f-b4f6-fea723ee703e': 'string', 'bf3b364cb9-ee9d-4289-8380-0f7bc29ce332': 'string', 'bfc13f7eed-6f53-4b41-b0d2-60b7d032530d': 'string'}}}
     field_id = '15'
     parts = [None]
     self = <BlockField 15 'Adresse postale'>
     subvalue = {'bf5c120215-c39f-43b6-9e2c-cf52f464122b': '11', 'bfe0710a21-7381-4518-a0bb-2024d6ef9761': None, 'bf486245af-bb5a-4d92-93eb-4a564620366c': 'rue de la rue', 'bf4134033e-4ce1-488f-b4f6-fea723ee703e': '59000', 'bf3b364cb9-ee9d-4289-8380-0f7bc29ce332': 'Lille', 'bfc13f7eed-6f53-4b41-b0d2-60b7d032530d': None}
     value = {'data': [{'bf5c120215-c39f-43b6-9e2c-cf52f464122b': '11', 'bfe0710a21-7381-4518-a0bb-2024d6ef9761': None, 'bf486245af-bb5a-4d92-93eb-4a564620366c': 'rue de la rue', 'bf4134033e-4ce1-488f-b4f6-fea723ee703e': '59000', 'bf3b364cb9-ee9d-4289-8380-0f7bc29ce332': 'Lille', 'bfc13f7eed-6f53-4b41-b0d2-60b7d032530d': None}], 'schema': {'bf5c120215-c39f-43b6-9e2c-cf52f464122b': 'string', 'bfe0710a21-7381-4518-a0bb-2024d6ef9761': 'string', 'bf486245af-bb5a-4d92-93eb-4a564620366c': 'string', 'bf4134033e-4ce1-488f-b4f6-fea723ee703e': 'string', 'bf3b364cb9-ee9d-4289-8380-0f7bc29ce332': 'string', 'bfc13f7eed-6f53-4b41-b0d2-60b7d032530d': 'string'}}

  File "/usr/lib/python3/dist-packages/wcs/fields.py", line 613, in set_value
   611         data['%s' % self.id] = value
   612         if self.store_display_value:
>  613             display_value = self.store_display_value(data, self.id)
   614             if display_value:
   615                 data['%s_display' % self.id] = display_value

  locals: 
     data = {'15': {'data': [{'bf5c120215-c39f-43b6-9e2c-cf52f464122b': '11', 'bfe0710a21-7381-4518-a0bb-2024d6ef9761': None, 'bf486245af-bb5a-4d92-93eb-4a564620366c': 'rue de la rue', 'bf4134033e-4ce1-488f-b4f6-fea723ee703e': '59000', 'bf3b364cb9-ee9d-4289-8380-0f7bc29ce332': 'Lille', 'bfc13f7eed-6f53-4b41-b0d2-60b7d032530d': None}], 'schema': {'bf5c120215-c39f-43b6-9e2c-cf52f464122b': 'string', 'bfe0710a21-7381-4518-a0bb-2024d6ef9761': 'string', 'bf486245af-bb5a-4d92-93eb-4a564620366c': 'string', 'bf4134033e-4ce1-488f-b4f6-fea723ee703e': 'string', 'bf3b364cb9-ee9d-4289-8380-0f7bc29ce332': 'string', 'bfc13f7eed-6f53-4b41-b0d2-60b7d032530d': 'string'}}}
     self = <BlockField 15 'Adresse postale'>
     value = {'data': [{'bf5c120215-c39f-43b6-9e2c-cf52f464122b': '11', 'bfe0710a21-7381-4518-a0bb-2024d6ef9761': None, 'bf486245af-bb5a-4d92-93eb-4a564620366c': 'rue de la rue', 'bf4134033e-4ce1-488f-b4f6-fea723ee703e': '59000', 'bf3b364cb9-ee9d-4289-8380-0f7bc29ce332': 'Lille', 'bfc13f7eed-6f53-4b41-b0d2-60b7d032530d': None}], 'schema': {'bf5c120215-c39f-43b6-9e2c-cf52f464122b': 'string', 'bfe0710a21-7381-4518-a0bb-2024d6ef9761': 'string', 'bf486245af-bb5a-4d92-93eb-4a564620366c': 'string', 'bf4134033e-4ce1-488f-b4f6-fea723ee703e': 'string', 'bf3b364cb9-ee9d-4289-8380-0f7bc29ce332': 'string', 'bfc13f7eed-6f53-4b41-b0d2-60b7d032530d': 'string'}}

  File "/usr/lib/python3/dist-packages/wcs/formdef.py", line 810, in get_field_data
   808         if d.get(field.id) is not None and field.convert_value_from_str:
   809             d[field.id] = field.convert_value_from_str(d[field.id])
>  810         field.set_value(d, d[field.id])
   811         if getattr(widget, 'cleanup', None):
   812             widget.cleanup()

  locals: 
     cls = <class 'wcs.formdef.FormDef'>
     d = {'15': {'data': [{'bf5c120215-c39f-43b6-9e2c-cf52f464122b': '11', 'bfe0710a21-7381-4518-a0bb-2024d6ef9761': None, 'bf486245af-bb5a-4d92-93eb-4a564620366c': 'rue de la rue', 'bf4134033e-4ce1-488f-b4f6-fea723ee703e': '59000', 'bf3b364cb9-ee9d-4289-8380-0f7bc29ce332': 'Lille', 'bfc13f7eed-6f53-4b41-b0d2-60b7d032530d': None}], 'schema': {'bf5c120215-c39f-43b6-9e2c-cf52f464122b': 'string', 'bfe0710a21-7381-4518-a0bb-2024d6ef9761': 'string', 'bf486245af-bb5a-4d92-93eb-4a564620366c': 'string', 'bf4134033e-4ce1-488f-b4f6-fea723ee703e': 'string', 'bf3b364cb9-ee9d-4289-8380-0f7bc29ce332': 'string', 'bfc13f7eed-6f53-4b41-b0d2-60b7d032530d': 'string'}}}
     field = <BlockField 15 'Adresse postale'>
     widget = <BlockWidget at 7fde5f3d3898: f15>

  File "/usr/lib/python3/dist-packages/wcs/formdef.py", line 678, in add_fields_to_form
   676             widget.field = field
   677             if transient_formdata and not widget.is_hidden:
>  678                 transient_formdata.data.update(self.get_field_data(field, widget))
   679                 # invalidate cache as comment fields (and other things?) may
   680                 # have accessed variables in non-lazy mode and caused a cache

  locals: 
     displayed_fields = [<TitleField 8 'Votre identité'>, <ItemField 9 'Vous êtes'>, <StringField 31 'Précisez'>, <TitleField 10 'Vos coordonnées'>, <StringField 11 'Nom'>, <StringField 12 'Prénom'>, <ItemField 13 'Résidez-vous en France ?'>, <BlockField 15 'Adresse postale'>]
     field = <BlockField 15 'Adresse postale'>
     form = <wcs.qommon.form.Form object at 0x7fde64ae2e48>
     form_data = None
     on_page = True
     page = <PageField 7 'Vos informations'>
     self = <FormDef 'BB- Demander un acte de naissace' id:186>
     transient_formdata = <FormData 'BB- Demander un acte de naissace - n°None' id:None>
     value = None
     visible = True
     widget = <BlockWidget at 7fde5f3d3898: f15>

  File "/usr/lib/python3/dist-packages/wcs/formdef.py", line 625, in create_form
   623         )
   624         self.add_fields_to_form(
>  625             form, page=page, displayed_fields=displayed_fields, transient_formdata=transient_formdata
   626         )
   627         return form

  locals: 
     displayed_fields = [<TitleField 8 'Votre identité'>, <ItemField 9 'Vous êtes'>, <StringField 31 'Précisez'>, <TitleField 10 'Vos coordonnées'>, <StringField 11 'Nom'>, <StringField 12 'Prénom'>, <ItemField 13 'Résidez-vous en France ?'>, <BlockField 15 'Adresse postale'>]
     form = <wcs.qommon.form.Form object at 0x7fde64ae2e48>
     page = <PageField 7 'Vos informations'>
     self = <FormDef 'BB- Demander un acte de naissace' id:186>
     transient_formdata = <FormData 'BB- Demander un acte de naissace - n°None' id:None>

  File "/usr/lib/python3/dist-packages/wcs/forms/root.py", line 795, in create_form
   793 
   794     def create_form(self, *args, **kwargs):
>  795         form = self.formdef.create_form(*args, **kwargs)
   796         form.attrs['data-live-url'] = self.formdef.get_url() + 'live'
   797         return form

  locals: 
     args = ()
     kwargs = {'page': <PageField 7 'Vos informations'>, 'displayed_fields': [<TitleField 8 'Votre identité'>, <ItemField 9 'Vous êtes'>, <StringField 31 'Précisez'>, <TitleField 10 'Vos coordonnées'>, <StringField 11 'Nom'>, <StringField 12 'Prénom'>, <ItemField 13 'Résidez-vous en France ?'>, <BlockField 15 'Adresse postale'>], 'transient_formdata': <FormData 'BB- Demander un acte de naissace - n°None' id:None>}
     self = <modules.formpage.AlternateFormPage object at 0x7fde5f2a4ba8>

  File "/usr/lib/python3/dist-packages/wcs/forms/root.py", line 1430, in live
  1428         displayed_fields = []
  1429         with get_publisher().substitutions.temporary_feed(formdata, force_mode='lazy'):
> 1430             form = self.create_form(page=page, displayed_fields=displayed_fields, transient_formdata=formdata)
  1431         formdata.data.update(self.formdef.get_data(form))
  1432         return FormStatusPage.live_process_fields(form, formdata, displayed_fields)

  locals: 
     displayed_fields = [<TitleField 8 'Votre identité'>, <ItemField 9 'Vous êtes'>, <StringField 31 'Précisez'>, <TitleField 10 'Vos coordonnées'>, <StringField 11 'Nom'>, <StringField 12 'Prénom'>, <ItemField 13 'Résidez-vous en France ?'>, <BlockField 15 'Adresse postale'>]
     field = <PageField 7 'Vos informations'>
     formdata = <FormData 'BB- Demander un acte de naissace - n°None' id:None>
     page = <PageField 7 'Vos informations'>
     page_id = '7'
     result_error = <function FormPage.live.<locals>.result_error at 0x7fde5ecd7048>
     self = <modules.formpage.AlternateFormPage object at 0x7fde5f2a4ba8>
     session = <Session at 7fde5ef704a8: MZ87tJlWiJPlJ7o-ZQp6lA>

(...)

Form:
f15$element0$fbf3b364cb9-ee9d-4289-8380-0f7bc29ce332 'Lille'
f15$element0$fbf4134033e-4ce1-488f-b4f6-fea723ee703e '59000'
f15$element0$fbf486245af-bb5a-4d92-93eb-4a564620366c 'rue de la rue'
f15$element0$fbf5c120215-c39f-43b6-9e2c-cf52f464122b '11'
f15$element0$fbfc13f7eed-6f53-4b41-b0d2-60b7d032530d ''
f15$element0$fbfe0710a21-7381-4518-a0bb-2024d6ef9761 ''

REQUEST_URI     '/bb-demander-un-acte-de-naissace/live'

History

#1

Updated by Frédéric Péters about 2 months ago

  • Description updated (diff)

Also available in: Atom PDF