Projet

Général

Profil

Bug #38541

Remplissage d'une données de traitement "tableau" par un gabarit

Ajouté par Nicolas Roche il y a plus de 4 ans. Mis à jour il y a plus de 3 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
16 décembre 2019
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

Ça plante au deuxième passage dans la fonction,
et sinon ça marche en passant le tableau via une expression python.

Exception:
  type = '<class 'psycopg2.DataError'>', value = 'malformed array literal: "[['1', '1'], [None, None], [None, None], ['2', '1'], [None, None], [None, None], [None, None], [None, None], [None, None]]" 
LINE 1: ...:bytea, fbo80d4d041_9c56_4a78_b74a_b811023bdcca = '[[''1'', ...
                                                             ^
DETAIL:  "[" must introduce explicitly-specified array dimensions.
'

Stack trace (most recent call first):
  File "/usr/lib/python2.7/dist-packages/wcs/sql.py", line 1432, in store
  1430                                        self._table_name,
  1431                                        ', '.join(['%s = %%(%s)s' % (x,x) for x in column_names]))
> 1432             cur.execute(sql_statement, sql_dict)
  1433             if cur.fetchone() is None:
  1434                 column_names = sql_dict.keys()

  locals: 
     column_names = ['status', 'last_update_time', 'f27', 'fbofed31ce9_4e81_4c12_a002_fdd088fd52e8_structured', 'concerned_roles_array', 'fbo29f99525_87dc_4e74_a334_fba5bb4748bb', 'fbo29f99525_87dc_4e74_a334_fba5bb4748bb_structured', 'f28', 'fbofed31ce9_4e81_4c12_a002_fdd088fd52e8_display', 'fboacee07e1_e891_4037_90b1_37d6a0455bf4', 'tracking_code', 'workflow_roles_array', 'fbo7cc8202f_bab9_4bd6_a200_f462b98d9b7f', 'fbo3d65b6ca_3d25_45fb_8f51_e6cc2b34dd51', 'fbo62f8cc57_6745_4593_a68f_b66cbd6b47f9', 'fbo80d4d041_9c56_4a78_b74a_b811023bdcca', 'fbo29f99525_87dc_4e74_a334_fba5bb4748bb_display', 'workflow_data', 'f23', 'workflow_roles', 'user_id', 'submission_context', 'actions_roles_array', 'fbofed31ce9_4e81_4c12_a002_fdd088fd52e8', 'f59', 'f30', 'f22', 'f21', 'receipt_time', 'anonymised', 'id_display', 'f24', 'backoffice_submission', 'geoloc_base', 'criticality_level', 'submission_channel', 'page_no']
     conn = <connection object at 0x7f277ae34e88; dsn: 'dbname=wcs_demarches_orleans_test_entrouvert_org user=wcs password=xxxxxxxxxxxxxxxx host=test.saas.entrouvert.org.clusters.entrouvert.org port=5432', closed: 0>
     cur = <cursor object at 0x7f278004ced8; closed: 0>
     field = 'base'
     self = <Encombrants-A-La-Demande 'Encombrants \xc3\xa0 la demande - n\xc2\xb0108-159' id:159>
     sql_dict = {'status': 'wf-3', 'last_update_time': datetime.datetime(2019, 12, 12, 11, 49, 50), 'f27': 'Gilles', 'fbofed31ce9_4e81_4c12_a002_fdd088fd52e8_structured': bytearray(b'\x80\x02N.'), 'concerned_roles_array': ['d0380cbe962148e9a11fe4d58ffc1d55'], 'fbo29f99525_87dc_4e74_a334_fba5bb4748bb': 'Collecte planifi\xc3\xa9e', 'fbo29f99525_87dc_4e74_a334_fba5bb4748bb_structured': bytearray(b'\x80\x02N.'), 'f28': 'GRISARD', 'fbofed31ce9_4e81_4c12_a002_fdd088fd52e8_display': '2 janvier 2020', 'fboacee07e1_e891_4037_90b1_37d6a0455bf4': '1069', 'tracking_code': 'SLQMZGGD', 'workflow_roles_array': None, 'fbo7cc8202f_bab9_4bd6_a200_f462b98d9b7f': '8 Rue de Bagneaux Saint-Jean-de-la-Ruelle', 'fbo3d65b6ca_3d25_45fb_8f51_e6cc2b34dd51': '0202020202', 'id': 159, 'fbo62f8cc57_6745_4593_a68f_b66cbd6b47f9': bytearray(b'\x80\x02(cwcs.qommon.form\nPicklableUpload\nq\x01oq\x02}q\x03(U\rorig_filenameq\x04U(Formulaire test pour les encombrants.pdfq\x05U\tqfilenameq\x06U@26f29514a9be8db038e3a151ba7c03da5138fbb9ca9a10c71ee9f4d47ee6b91eq\x07U\rbase_filenameq\x08h\x05U\x07charsetq\tNU\x0ccontent_typeq\nU\x0fapplication/pdfq\x0bub.'), 'fbo80d4d041_9c56_4a78_b74a_b811023bdcca': "[['1', '1'], [None, None], [None, None], ['2', '1'], [None, None], [None, None], [None, None], [None, None], [None, None]]", 'fbo29f99525_87dc_4e74_a334_fba5bb4748bb_display': 'Collecte planifi\xc3\xa9e', 'workflow_data': bytearray(b'\x80\x02}q\x01(U#entretien_var_choix_devenir_demandeq\x02U\x0bA collecterq\x03U\x17entretien_var_event_api}q\x04(U\x0cfillslot_urlUahttps://chrono-orleans.test.entrouvert.org/api/agenda/encombrants-a-la-demande/fillslot/47901378/q\x05U\nstatus_urlU_https://chrono-orleans.test.entrouvert.org/api/agenda/encombrants-a-la-demande/status/47901378/q\x06uU\x1cdemande_var_secteur_collecteq\x07U\x0bOlivet nordq\x08U\x12reservation_statusq\tK\xc8U\x1creservation_connection_errorq\nU\x16invalid scheme in URL q\x0bU\x1fentretien_var_event_descriptionq\x0cU\x00U\x10reservation_timeq\rU\x1a2019-12-12T11:49:23.316554q\x0eU\x1centretien_var_event_datetimeq\x0fU\x132020-01-02 11:55:00q\x10U\'entretien_var_choix_devenir_demande_rawq\x11h\x03U\x13entretien_var_eventq\x12U\x0e2 janvier 2020q\x13U\x17entretien_var_event_rawq\x14U\x0847901378q\x15U\x1areservation_app_error_codeq\x16K\x00U\x14reservation_response}q\x17(U\x03errK\x00U\x06places}q\x18(U\tavailableK\x07U\x05totalK\nU\x08reservedK\x03uU\x0fin_waiting_list\x89U\x08datetimeU\x132020-01-02 11:55:00q\x19U\nbooking_idM-\x04U\x03api}q\x1a(U\ncancel_urlUChttps://chrono-orleans.test.entrouvert.org/api/booking/1069/cancel/q\x1bU\x07ics_urlU@https://chrono-orleans.test.entrouvert.org/api/booking/1069/ics/q\x1cuuU\x1centretien_var_event_disabledq\x1d\x89U\x15entretien_var_tableauq\x1e]q\x1f(]q (U\x011U\x011e]q!(NNe]q"(NNe]q#(U\x012U\x011e]q$(NNe]q%(NNe]q&(NNe]q\'(NNe]q((NNeeU\x18entretien_var_event_slugq)NU demande_var_secteur_collecte_rawq*h\x08u.'), 'f23': 'Rue de Bagneaux', 'workflow_roles': None, 'user_id': '203', 'submission_context': None, 'actions_roles_array': ['d0380cbe962148e9a11fe4d58ffc1d55'], 'fbofed31ce9_4e81_4c12_a002_fdd088fd52e8': '2 janvier 2020', 'f59': 'gilles.grisard@orleans-metropole.fr', 'f30': '0202020202', 'f22': '8', 'f21': '47.9145932559;1.88123703003', 'receipt_time': datetime.datetime(2019, 12, 12, 11, 0, 27), 'anonymised': None, 'id_display': '108-159', 'f24': 'Saint-Jean-de-la-Ruelle', 'backoffice_submission': False, 'geoloc_base': '(1.881076, 47.914336)', 'criticality_level': 0, 'submission_channel': None, 'page_no': '3'}
     sql_statement = 'UPDATE formdata_108_encombrants_a_la_demande SET status = %(status)s, last_update_time = %(last_update_time)s, f27 = %(f27)s, fbofed31ce9_4e81_4c12_a002_fdd088fd52e8_structured = %(fbofed31ce9_4e81_4c12_a002_fdd088fd52e8_structured)s, concerned_roles_array = %(concerned_roles_array)s, fbo29f99525_87dc_4e74_a334_fba5bb4748bb = %(fbo29f99525_87dc_4e74_a334_fba5bb4748bb)s, fbo29f99525_87dc_4e74_a334_fba5bb4748bb_structured = %(fbo29f99525_87dc_4e74_a334_fba5bb4748bb_structured)s, f28 = %(f28)s, fbofed31ce9_4e81_4c12_a002_fdd088fd52e8_display = %(fbofed31ce9_4e81_4c12_a002_fdd088fd52e8_display)s, fboacee07e1_e891_4037_90b1_37d6a0455bf4 = %(fboacee07e1_e891_4037_90b1_37d6a0455bf4)s, tracking_code = %(tracking_code)s, workflow_roles_array = %(workflow_roles_array)s, fbo7cc8202f_bab9_4bd6_a200_f462b98d9b7f = %(fbo7cc8202f_bab9_4bd6_a200_f462b98d9b7f)s, fbo3d65b6ca_3d25_45fb_8f51_e6cc2b34dd51 = %(fbo3d65b6ca_3d25_45fb_8f51_e6cc2b34dd51)s, fbo62f8cc57_6745_4593_a68f_b66cbd6b47f9 = %(fbo62f8cc57_6745_4593_a68f_b66cbd6b47f9)s, fbo80d4d041_9c56_4a78_b74a_b811023bdcca = %(fbo80d4d041_9c56_4a78_b74a_b811023bdcca)s, fbo29f99525_87dc_4e74_a334_fba5bb4748bb_display = %(fbo29f99525_87dc_4e74_a334_fba5bb4748bb_display)s, workflow_data = %(workflow_data)s, f23 = %(f23)s, workflow_roles = %(workflow_roles)s, user_id = %(user_id)s, submission_context = %(submission_context)s, actions_roles_array = %(actions_roles_array)s, fbofed31ce9_4e81_4c12_a002_fdd088fd52e8 = %(fbofed31ce9_4e81_4c12_a002_fdd088fd52e8)s, f59 = %(f59)s, f30 = %(f30)s, f22 = %(f22)s, f21 = %(f21)s, receipt_time = %(receipt_time)s, anonymised = %(anonymised)s, id_display = %(id_display)s, f24 = %(f24)s, backoffice_submission = %(backoffice_submission)s, geoloc_base = %(geoloc_base)s, criticality_level = %(criticality_level)s, submission_channel = %(submission_channel)s, page_no = %(page_no)s WHERE id = %(id)s RETURNING id'
     value = '(1.881076, 47.914336)'
     x = 'page_no'

  File "/usr/lib/python2.7/dist-packages/wcs/qommon/substitution.py", line 28, in f
    26             return func(*args, **kwargs)
    27         finally:
>   28             get_publisher().substitutions.invalidate_cache()
    29     return f
    30 

  locals: 
     args = (<Encombrants-A-La-Demande 'Encombrants \xc3\xa0 la demande - n\xc2\xb0108-159' id:159>,)
     func = <function store at 0x7f27803a58c0>
     kwargs = {}

  File "/usr/lib/python2.7/dist-packages/wcs/sql.py", line 396, in f
   394         except psycopg2.Error:
   395             get_connection().rollback()
>  396             raise
   397     return f
   398 

  locals: 
     args = (<Encombrants-A-La-Demande 'Encombrants \xc3\xa0 la demande - n\xc2\xb0108-159' id:159>,)
     func = <function f at 0x7f27803a5938>
     kwargs = {}

  File "/usr/lib/python2.7/dist-packages/wcs/wf/backoffice_fields.py", line 153, in perform
   151             # store formdata everytime so substitution cache is invalidated,
   152             # and backoffice field values can be used in subsequent fields.
>  153             formdata.store()
   154 
   155     def fields_export_to_xml(self, item, charset, include_id=False):

  locals: 
     display_value = '2 janvier 2020'
     field = {'field_id': 'bo80d4d041-9c56-4a78-b74a-b811023bdcca', 'value': '{{entretien_var_tableau}}'}
     formdata = <Encombrants-A-La-Demande 'Encombrants \xc3\xa0 la demande - n\xc2\xb0108-159' id:159>
     formdef_field = <TableField bo80d4d041-9c56-4a78-b74a-b811023bdcca 'Liste des encombrants \xc3\xa0 collecter'>
     new_value = "[['1', '1'], [None, None], [None, None], ['2', '1'], [None, None], [None, None], [None, None], [None, None], [None, None]]" 
     self = <SetBackofficeFieldsWorkflowStatusItem 7>
     structured_value = None
     x = <TableField bo80d4d041-9c56-4a78-b74a-b811023bdcca 'Liste des encombrants \xc3\xa0 collecter'>

  File "/usr/lib/python2.7/dist-packages/wcs/workflows.py", line 71, in perform_items
    69             url = item.perform(formdata) or url
    70         except AbortActionException:
>   71             break
    72         if formdata.status != old_status:
    73             break

  locals: 
     depth = 20
     formdata = <Encombrants-A-La-Demande 'Encombrants \xc3\xa0 la demande - n\xc2\xb0108-159' id:159>
     item = <SetBackofficeFieldsWorkflowStatusItem 7>
     items = [<ExportToModel 6>, <SetBackofficeFieldsWorkflowStatusItem 7>, <RegisterCommenterWorkflowStatusItem 8>, <SendmailWorkflowStatusItem 4>, <SendmailWorkflowStatusItem 9>, <ChoiceWorkflowStatusItem 1>, <ChoiceWorkflowStatusItem 2>, <ChoiceWorkflowStatusItem 5>, <ChoiceWorkflowStatusItem 10>]
     old_status = 'wf-3'
     url = None

  File "/usr/lib/python2.7/dist-packages/wcs/formdata.py", line 483, in perform_workflow
   481         wf_status = self.get_status()
   482         from wcs.workflows import perform_items
>  483         url = perform_items(wf_status.items, self)
   484         return url
   485 

  locals: 
     perform_items = <function perform_items at 0x7f27869b6848>
     self = <Encombrants-A-La-Demande 'Encombrants \xc3\xa0 la demande - n\xc2\xb0108-159' id:159>
     url = None
     wf_status = <WorkflowStatus 3 'Rendez-vous r\xc3\xa9serv\xc3\xa9'>

  File "/usr/lib/python2.7/dist-packages/wcs/workflows.py", line 1538, in handle_form
  1536             filled.status = evo.status
  1537         filled.store()
> 1538         url = filled.perform_workflow()
  1539         if url:
  1540             return url

  locals: 
     action = <wcs.workflows.WorkflowGlobalAction object at 0x7f277b449110>
     evo = <wcs.formdata.Evolution object at 0x7f2778f84550>
     filled = <Encombrants-A-La-Demande 'Encombrants \xc3\xa0 la demande - n\xc2\xb0108-159' id:159>
     form = <wcs.qommon.form.Form object at 0x7f277b4fd310>
     item = <JumpOnSubmitWorkflowStatusItem 11>
     next_url = None
     self = <WorkflowStatus 22 'Entretien t\xc3\xa9l\xc3\xa9phonique'>
     user = <SqlUser 'Gilles GRISARD' id:203>

  File "/usr/lib/python2.7/dist-packages/wcs/formdata.py", line 573, in handle_workflow_form
   571         if not wf_status:
   572             return None
>  573         return wf_status.handle_form(form, self, user)
   574 
   575     def evaluate_live_workflow_form(self, user, form):

  locals: 
     form = <wcs.qommon.form.Form object at 0x7f277b4fd310>
     self = <Encombrants-A-La-Demande 'Encombrants \xc3\xa0 la demande - n\xc2\xb0108-159' id:159>
     user = <SqlUser 'Gilles GRISARD' id:203>
     wf_status = <WorkflowStatus 22 'Entretien t\xc3\xa9l\xc3\xa9phonique'>

  File "/usr/lib/python2.7/dist-packages/wcs/forms/common.py", line 599, in submit
   597         current_status = self.filled.status
   598         user = get_request().user
>  599         next_url = self.filled.handle_workflow_form(user, form)
   600         if next_url:
   601             return next_url

  locals: 
     current_status = 'wf-22'
     form = <wcs.qommon.form.Form object at 0x7f277b4fd310>
     self = <wcs.backoffice.management.FormBackOfficeStatusPage object at 0x7f277b1b1790>
     user = <SqlUser 'Gilles GRISARD' id:203>

  File "/usr/lib/python2.7/dist-packages/wcs/forms/common.py", line 291, in check_submitted_form
   289             if form.has_errors():
   290                 return
>  291             url = self.submit(form)
   292             if url is None:
   293                 url = get_request().get_frontoffice_url()

  locals: 
     form = <wcs.qommon.form.Form object at 0x7f277b4fd310>
     self = <wcs.backoffice.management.FormBackOfficeStatusPage object at 0x7f277b1b1790>
     submit_button = <SubmitWidget at 7f277b4fd490: submit>
     submit_button_name = 'submit'

  File "/usr/lib/python2.7/dist-packages/wcs/forms/common.py", line 524, in status
   522         user = self.check_receiver()
   523         form = self.get_workflow_form(user)
>  524         response = self.check_submitted_form(form)
   525         if response:
   526             get_session().unmark_visited_object(object_key)

  locals: 
     form = <wcs.qommon.form.Form object at 0x7f277b4fd310>
     object_key = 'formdata-encombrants-a-la-demande-159'
     self = <wcs.backoffice.management.FormBackOfficeStatusPage object at 0x7f277b1b1790>
     user = <SqlUser 'Gilles GRISARD' id:203>

  File "/usr/lib/python2.7/dist-packages/wcs/backoffice/management.py", line 2131, in _q_index
  2129 
  2130         get_response().filter['sidebar'] = self.get_sidebar()
> 2131         return self.status()
  2132 
  2133     def receipt(self, *args, **kwargs):

  locals: 
     self = <wcs.backoffice.management.FormBackOfficeStatusPage object at 0x7f277b1b1790>

  File "/usr/lib/python2.7/dist-packages/quixote/directory.py", line 67, in _q_traverse
    65                 raise TraversalError
    66         elif hasattr(obj, '__call__'):
>   67             return obj()
    68         else:
    69             return obj

  locals: 
     component = ''
     name = '_q_index'
     obj = <bound method FormBackOfficeStatusPage._q_index of <wcs.backoffice.management.FormBackOfficeStatusPage object at 0x7f277b1b1790>>
     path = []
     self = <wcs.backoffice.management.FormBackOfficeStatusPage object at 0x7f277b1b1790>

  File "/usr/lib/python2.7/dist-packages/wcs/forms/common.py", line 710, in _q_traverse
   708         get_response().breadcrumb.append(
   709             (str(self.filled.id) + '/' , self.filled.get_display_id()))
>  710         return super(FormStatusPage, self)._q_traverse(path)
   711 
   712     def wfedit(self, action_id):

  locals: 
     path = ['']
     self = <wcs.backoffice.management.FormBackOfficeStatusPage object at 0x7f277b1b1790>

  File "/usr/lib/python2.7/dist-packages/quixote/directory.py", line 63, in _q_traverse
    61         if path:
    62             if hasattr(obj, '_q_traverse'):
>   63                 return obj._q_traverse(path)
    64             else:
    65                 raise TraversalError

  locals: 
     component = '159'
     name = None
     obj = <wcs.backoffice.management.FormBackOfficeStatusPage object at 0x7f277b1b1790>
     path = ['']
     self = <wcs.backoffice.management.FormPage object at 0x7f277af6c210>

  File "/usr/lib/python2.7/dist-packages/quixote/directory.py", line 63, in _q_traverse
    61         if path:
    62             if hasattr(obj, '_q_traverse'):
>   63                 return obj._q_traverse(path)
    64             else:
    65                 raise TraversalError

  locals: 
     component = 'encombrants-a-la-demande'
     name = None
     obj = <wcs.backoffice.management.FormPage object at 0x7f277af6c210>
     path = ['159', '']
     self = <wcs.backoffice.management.ManagementDirectory object at 0x7f2786004f10>

  File "/usr/lib/python2.7/dist-packages/wcs/backoffice/management.py", line 453, in _q_traverse
   451     def _q_traverse(self, path):
   452         get_response().breadcrumb.append(('management/', _('Management')))
>  453         return super(ManagementDirectory, self)._q_traverse(path)
   454 
   455     def _q_index(self):

  locals: 
     path = ['encombrants-a-la-demande', '159', '']
     self = <wcs.backoffice.management.ManagementDirectory object at 0x7f2786004f10>

  File "/usr/lib/python2.7/dist-packages/quixote/directory.py", line 63, in _q_traverse
    61         if path:
    62             if hasattr(obj, '_q_traverse'):
>   63                 return obj._q_traverse(path)
    64             else:
    65                 raise TraversalError

  locals: 
     component = 'management'
     name = None
     obj = <wcs.backoffice.management.ManagementDirectory object at 0x7f2786004f10>
     path = ['encombrants-a-la-demande', '159', '']
     self = <auquotidien.modules.backoffice.BackofficeRootDirectory object at 0x7f27800a74d0>

  File "/usr/lib/python2.7/dist-packages/quixote/directory.py", line 91, in _q_traverse
    89     def _q_traverse(self, path):
    90         self._q_access()
>   91         return super(AccessControlled, self)._q_traverse(path)
    92 
    93 

  locals: 
     path = ['management', 'encombrants-a-la-demande', '159', '']
     self = <auquotidien.modules.backoffice.BackofficeRootDirectory object at 0x7f27800a74d0>

  File "/usr/lib/python2.7/dist-packages/wcs/backoffice/root.py", line 88, in _q_traverse
    86             # legacy /backoffice/categories/<...>, redirect.
    87             return redirect('/backoffice/forms/' + '/'.join(path))
>   88         return super(RootDirectory, self)._q_traverse(path)
    89 
    90     @classmethod

  locals: 
     path = ['management', 'encombrants-a-la-demande', '159', '']
     self = <auquotidien.modules.backoffice.BackofficeRootDirectory object at 0x7f27800a74d0>

  File "/usr/lib/python2.7/dist-packages/quixote/directory.py", line 63, in _q_traverse
    61         if path:
    62             if hasattr(obj, '_q_traverse'):
>   63                 return obj._q_traverse(path)
    64             else:
    65                 raise TraversalError

  locals: 
     component = 'backoffice'
     name = 'backoffice'
     obj = <auquotidien.modules.backoffice.BackofficeRootDirectory object at 0x7f27800a74d0>
     path = ['management', 'encombrants-a-la-demande', '159', '']
     self = <auquotidien.modules.root.AlternateRootDirectory object at 0x7f2782ff45d0>

  File "/usr/lib/python2.7/dist-packages/auquotidien/modules/root.py", line 346, in _q_traverse
   344                     return redirect('%s%s/%s' % (base_url, f.category.url_name, uri_rest))
   345 
>  346             raise e
   347 
   348 

  locals: 
     path = ['backoffice', 'management', 'encombrants-a-la-demande', '159', '']
     response = <wcs.qommon.http_response.HTTPResponse instance at 0x7f277b183680>
     self = <auquotidien.modules.root.AlternateRootDirectory object at 0x7f2782ff45d0>

  File "/usr/lib/python2.7/dist-packages/quixote/publish.py", line 253, in try_publish
   251                 permanent=True)
   252         components = path[1:].split('/')
>  253         output = self.root_directory._q_traverse(components)
   254         # The callable ran OK, commit any changes to the session
   255         self.finish_successful_request()

  locals: 
     components = ['backoffice', 'management', 'encombrants-a-la-demande', '159', '']
     path = '/backoffice/management/encombrants-a-la-demande/159/'
     request = <wcs.compat.CompatHTTPRequest instance at 0x7f277b183050>
     self = <wcs.compat.CompatWcsPublisher object at 0x7f2782ff4590>

  File "/usr/lib/python2.7/dist-packages/wcs/views.py", line 42, in get_context_data
    40                 get_publisher().session_manager.finish_successful_request()
    41             self.quixote_response = get_request().response
>   42             context.update(template.get_decorate_vars(body, get_response(), generate_breadcrumb=True))
    43 
    44         return context

  locals: 
     context = {u'view': <wcs.views.Backoffice object at 0x7f277b449d10>}
     kwargs = {}
     self = <wcs.views.Backoffice object at 0x7f277b449d10>

  File "/usr/lib/python2.7/dist-packages/wcs/compat.py", line 58, in get
    56             self.quixote_response = get_request().response
    57         except Exception as exc:
>   58             context = {'body': get_publisher().finish_failed_request()}
    59             self.quixote_response = get_request().response
    60 

  locals: 
     args = ()
     exc = DataError('malformed array literal: "[[\'1\', \'1\'], [None, None], [None, None], [\'2\', \'1\'], [None, None], [None, None], [None, None], [None, None], [None, None]]"\nLINE 1: ...:bytea, fbo80d4d041_9c56_4a78_b74a_b811023bdcca = \'[[\'\'1\'\', ...\n                                                             ^\nDETAIL:  "[" must introduce explicitly-specified array dimensions.\n',)
     kwargs = {}
     request = <WSGIRequest: POST '/backoffice/management/encombrants-a-la-demande/159/'>
     self = <wcs.views.Backoffice object at 0x7f277b449d10>

  File "/usr/lib/python2.7/dist-packages/wcs/views.py", line 29, in post
    27 
    28     def post(self, request, *args, **kwargs):
>   29         return self.get(request, *args, **kwargs)
    30 
    31     def get_context_data(self, **kwargs):

  locals: 
     args = ()
     kwargs = {}
     request = <WSGIRequest: POST '/backoffice/management/encombrants-a-la-demande/159/'>
     self = <wcs.views.Backoffice object at 0x7f277b449d10>

  File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py", line 88, in dispatch
    86         else:
    87             handler = self.http_method_not_allowed
>   88         return handler(request, *args, **kwargs)
    89 
    90     def http_method_not_allowed(self, request, *args, **kwargs):

  locals: 
     args = ()
     handler = <bound method Backoffice.post of <wcs.views.Backoffice object at 0x7f277b449d10>>
     kwargs = {}
     request = <WSGIRequest: POST '/backoffice/management/encombrants-a-la-demande/159/'>
     self = <wcs.views.Backoffice object at 0x7f277b449d10>

  File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py", line 68, in view
    66             self.args = args
    67             self.kwargs = kwargs
>   68             return self.dispatch(request, *args, **kwargs)
    69         view.view_class = cls
    70         view.view_initkwargs = initkwargs

  locals: 
     args = ()
     cls = <class 'wcs.views.Backoffice'>
     initkwargs = {}
     kwargs = {}
     request = <WSGIRequest: POST '/backoffice/management/encombrants-a-la-demande/159/'>
     self = <wcs.views.Backoffice object at 0x7f277b449d10>

  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 185, in _get_response
   183             wrapped_callback = self.make_view_atomic(callback)
   184             try:
>  185                 response = wrapped_callback(request, *callback_args, **callback_kwargs)
   186             except Exception as e:
   187                 response = self.process_exception_by_middleware(e, request)

  locals: 
     callback = <function Backoffice at 0x7f2782fefc08>
     callback_args = ()
     callback_kwargs = {}
     middleware_method = <bound method PrometheusStatsMiddleware.process_view of <hobo.middleware.stats.PrometheusStatsMiddleware object at 0x7f27838353d0>>
     request = <WSGIRequest: POST '/backoffice/management/encombrants-a-la-demande/159/'>
     resolver = <RegexURLResolver 'wcs.urls' (None:None) ^/>
     resolver_match = ResolverMatch(func=wcs.views.Backoffice, args=(), kwargs={}, url_name=None, app_names=[], namespaces=[])
     response = None
     self = <django.core.handlers.wsgi.WSGIHandler object at 0x7f278b8139d0>
     wrapped_callback = <function Backoffice at 0x7f2782fefc08>

  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
   247 
   248         if response is None:
>  249             response = self._get_response(request)
   250         return response

  locals: 
     middleware_method = <bound method PrometheusStatsMiddleware.process_request of <hobo.middleware.stats.PrometheusStatsMiddleware object at 0x7f27838353d0>>
     request = <WSGIRequest: POST '/backoffice/management/encombrants-a-la-demande/159/'>
     response = None
     self = <django.core.handlers.wsgi.WSGIHandler object at 0x7f278b8139d0>

  File "/usr/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 41, in inner
    39     def inner(request):
    40         try:
>   41             response = get_response(request)
    42         except Exception as exc:
    43             response = response_for_exception(request, exc)

  locals: 
     get_response = <bound method WSGIHandler._legacy_get_response of <django.core.handlers.wsgi.WSGIHandler object at 0x7f278b8139d0>>
     request = <WSGIRequest: POST '/backoffice/management/encombrants-a-la-demande/159/'>

  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 124, in get_response
   122         set_urlconf(settings.ROOT_URLCONF)
   123 
>  124         response = self._middleware_chain(request)
   125 
   126         # This block is only needed for legacy MIDDLEWARE_CLASSES; if

  locals: 
     request = <WSGIRequest: POST '/backoffice/management/encombrants-a-la-demande/159/'>
     self = <django.core.handlers.wsgi.WSGIHandler object at 0x7f278b8139d0>

  File "/usr/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 157, in __call__
   155         signals.request_started.send(sender=self.__class__, environ=environ)
   156         request = self.request_class(environ)
>  157         response = self.get_response(request)
   158 
   159         response._handler_class = self.__class__

  locals: 
     environ = {'HTTP_REFERER': 'https://demarches-orleans.test.entrouvert.org/backoffice/management/encombrants-a-la-demande/159/', 'SERVER_PROTOCOL': 'HTTP/1.0', 'uwsgi.version': '2.0.14-debian', 'SCRIPT_NAME': '', 'REQUEST_METHOD': 'POST', 'PATH_INFO': '/backoffice/management/encombrants-a-la-demande/159/', 'HTTP_ORIGIN': 'https://demarches-orleans.test.entrouvert.org', 'HTTP_X_FORWARDED_SSL': 'on', 'QUERY_STRING': '', 'HTTP_X_REAL_IP': '212.234.73.91', 'CONTENT_LENGTH': '2332', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0', 'HTTP_CONNECTION': 'close', 'HTTP_COOKIE': 'publik_portal_agent_url=https%3A%2F%2Fagents-orleans.test.entrouvert.org%2F; publik_portal_agent_title=Portail%20agent; wcs-287497="2f3af471c7c94de3"; a2-opened-session-05c626=1', 'SERVER_NAME': 'wcs', 'REMOTE_ADDR': '212.234.73.91', 'HTTP_X_FORWARDED_PROTOCOL': 'ssl', 'wsgi.url_scheme': 'https', 'SERVER_PORT': '80', 'uwsgi.node': 'wcs', 'HTTP_X_PUBLIK_CLUSTER_BACKEND': 'wcs-balancer', 'HTTP_X_FORWARDED_PROTO': 'https', 'wsgi.input': <uwsgi._Input object at 0x7f277b1bb9a8>, 'HTTP_HOST': 'demarches-orleans.test.entrouvert.org', 'wsgi.multithread': False, 'HTTP_UPGRADE_INSECURE_REQUESTS': '1', 'REQUEST_URI': '/backoffice/management/encombrants-a-la-demande/159/', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'wsgi.version': (1, 0), 'HTTP_X_FORWARDED_FOR': '212.234.73.91, 212.234.73.91', 'wsgi.errors': <open file 'wsgi_errors', mode 'w' at 0x7f278382a300>, 'wsgi.multiprocess': True, 'HTTP_ACCEPT_LANGUAGE': 'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3', 'wsgi.run_once': False, 'CONTENT_TYPE': 'multipart/form-data; boundary=---------------------------139312630816944', 'wsgi.file_wrapper': <built-in function uwsgi_sendfile>, 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, br'}
     request = <WSGIRequest: POST '/backoffice/management/encombrants-a-la-demande/159/'>
     self = <django.core.handlers.wsgi.WSGIHandler object at 0x7f278b8139d0>
     start_response = <built-in function uwsgi_spit>

Form:
f3              'A collecter'
f5              '47901378'
f7              ''
f8              'vds'
f9$c-0-0        '1'
f9$c-0-1        '1'
f9$c-1-0        ''
f9$c-1-1        ''
f9$c-2-0        ''
f9$c-2-1        ''
f9$c-3-0        '2'
f9$c-3-1        '1'
f9$c-4-0        ''
f9$c-4-1        ''
f9$c-5-0        ''
f9$c-5-1        ''
f9$c-6-0        ''
f9$c-6-1        ''
f9$c-7-0        ''
f9$c-7-1        ''
f9$c-8-0        ''
f9$c-8-1        ''
geoloc_base$latlng '47.914336;1.881076'
submit          'Valider'

Cookies:
a2-opened-session-05c626 '1'
publik_portal_agent_title 'Portail%20agent'
publik_portal_agent_url 'https%3A%2F%2Fagents-orleans.test.entrouvert.org%2F'
wcs-287497      '2f3af471c7c94de3'

Environment:
CONTENT_LENGTH  '2332'
CONTENT_TYPE    'multipart/form-data; boundary=---------------------------139312630816944'
HTTP_ACCEPT     'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
HTTP_ACCEPT_ENCODING 'gzip, deflate, br'
HTTP_ACCEPT_LANGUAGE 'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3'
HTTP_CONNECTION 'close'
HTTP_COOKIE     'publik_portal_agent_url=https%3A%2F%2Fagents-orleans.test.entrouvert.org%2F; publik_portal_agent_title=Portail%20agent; wcs-287497="2f3af471c7c94de3"; a2-opened-session-05c626=1'
HTTP_HOST       'demarches-orleans.test.entrouvert.org'
HTTP_ORIGIN     'https://demarches-orleans.test.entrouvert.org'
HTTP_REFERER    'https://demarches-orleans.test.entrouvert.org/backoffice/management/encombrants-a-la-demande/159/'
HTTP_UPGRADE_INSECURE_REQUESTS '1'
HTTP_USER_AGENT 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0'
HTTP_X_FORWARDED_FOR '212.234.73.91, 212.234.73.91'
HTTP_X_FORWARDED_PROTO 'https'
HTTP_X_FORWARDED_PROTOCOL 'ssl'
HTTP_X_FORWARDED_SSL 'on'
HTTP_X_PUBLIK_CLUSTER_BACKEND 'wcs-balancer'
HTTP_X_REAL_IP  '212.234.73.91'
PATH_INFO       '/backoffice/management/encombrants-a-la-demande/159/'
QUERY_STRING    ''
REMOTE_ADDR     '212.234.73.91'
REMOTE_USER     '203'
REQUEST_METHOD  'POST'
REQUEST_URI     '/backoffice/management/encombrants-a-la-demande/159/'
SCRIPT_NAME     ''
SERVER_NAME     'wcs'
SERVER_PORT     '80'
SERVER_PROTOCOL 'HTTP/1.0'
uwsgi.node      'wcs'
uwsgi.version   '2.0.14-debian'
wsgi.errors     <open file 'wsgi_errors', mode 'w' at 0x7f278382a300>
wsgi.file_wrapper <built-in function uwsgi_sendfile>
wsgi.input      <uwsgi._Input object at 0x7f277b1bb9a8>
wsgi.multiprocess True
wsgi.multithread False
wsgi.run_once   False
wsgi.url_scheme 'https'
wsgi.version    (1, 0)

Fichiers


Demandes liées

Lié à w.c.s. - Bug #38746: lazy-pickle sur les variables de type tableRejeté02 janvier 2020

Actions

Historique

#2

Mis à jour par Frédéric Péters il y a plus de 4 ans

  • Sujet changé de Affichage d'un tableau dans un gabari à Remplissage d'une données de traitement "tableau" par un gabarit

Les gabarits produisent des chaines de caractères, le champ "tableau" attend un tableau.

Le ticket est pour qu'on n'autorise pas l'assignation d'une info "gabarit" pour une données de traitement "tableau" ?

#3

Mis à jour par Nicolas Roche il y a plus de 4 ans

Les gabarits produisent des chaines de caractères

merci, je n'avais pas tilté.

Le ticket est pour qu'on n'autorise pas l'assignation d'une info "gabarit" pour une données de traitement "tableau" ?

du coup oui, peut-être aussi remonter un message adéquat (expliquant qu'il faut utiliser les expressions python pour les champs typés).

#4

Mis à jour par Nicolas Roche il y a plus de 4 ans

Puisque l'erreur arrive dans le workflow on ne peut pas retourner de message.
En fait il me faudrait plutôt intervenir en amont sur les pages d'admin.
Je pose un test qui reproduit l'erreur au cas où on voudrait quand même intercepter l'exception.
edit: j'ai déplacé ce premier test dans #38746

#5

Mis à jour par Nicolas Roche il y a plus de 4 ans

  • Statut changé de Solution proposée à Nouveau
#6

Mis à jour par Nicolas Roche il y a plus de 4 ans

  • Lié à Bug #38746: lazy-pickle sur les variables de type table ajouté
#7

Mis à jour par Nicolas Roche il y a plus de 4 ans

J'affiche une erreur si l'on affecte un champ table avec du text ou un gabarit Django,
puisque seules les expressions pythons peuvent fournir un tableaux.

En revanche, pour être complet il faudrait être en mesure d'évaluer l'expression python pour vérifier qu'elle retourne bien un tableau ;
ce qui ne me semble pas aisé ici (les variables contenues dans l'expression python peuvent ne pas être encore définie).

#8

Mis à jour par Nicolas Roche il y a plus de 4 ans

Nouveau patch parce que j'ai oublié l'appel à gettext sur la chaîne.

Mais sinon je suis vexé car je n'arrive pas à reproduire les 3 erreurs de jenkins en local.
Pourtant j'ai bien la même version de mechanize (0.4.5)

>       return not bool(BAD_URI_CHARS_RE.search(uri))
E       TypeError: cannot use a string pattern on a bytes-like object
/tmp/tox-jenkins/wcs/wip/38541-array-field-from-string/py3/lib/python3.5/site-packages/mechanize/_rfc3986.py:69: TypeError

#9

Mis à jour par Frédéric Péters il y a plus de 4 ans

Mais sinon je suis vexé car je n'arrive pas à reproduire les 3 erreurs de jenkins en local.

Parce que tu n'avais pas "tests: force string URL in widget tests (required for mechanize≥0.4.5)" dans la branche sur jenkins.

#10

Mis à jour par Frédéric Péters il y a plus de 3 ans

  • Statut changé de En cours à Fermé

Ça doit être rendu obsolète par #41847.

Formats disponibles : Atom PDF