Project

General

Profile

Bug #90936

prefill, get_by_id_criteria appelé avec un LazyFormDefObjectsManager (TypeError: int() argument must be a string, a bytes-like object or a real number, not 'LazyFormDefObjectsMan...)

Added by Sentry Io 10 months ago. Updated 10 months ago.

Status:
Fermé
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
22 May 2024
Due date:
% Done:

0%

Estimated time:
Patch proposed:
No
Planning:
No

Description

https://sentry.entrouvert.org/entrouvert/publik/issues/126492/

TypeError: int() argument must be a string, a bytes-like object or a real number, not 'LazyFormDefObjectsManager'
(10 additional frame(s) were not displayed)
...
  File "wcs/fields/item.py", line 347, in get_prefill_value
    struct_value = data_source.get_structured_value(value)
  File "wcs/data_sources.py", line 1115, in get_structured_value
    value = self.get_card_structured_value_by_id(option_id)
  File "wcs/data_sources.py", line 1099, in get_card_structured_value_by_id
    values = CardDef.get_data_source_items(self.type, get_by_id=option_id)
  File "wcs/carddef.py", line 258, in get_data_source_items
    criterias.append(carddef.get_by_id_criteria(get_by_id))
  File "wcs/formdef.py", line 899, in get_by_id_criteria
    if int(value) >= 2**31:

Related issues

Related to w.c.s. - Bug #90572: préremplissage d'un champ liste (sourcée sur des fiches) avec une liste (TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list')Fermé14 May 2024

Actions

History

#1

Updated by Lauréline Guérin 10 months ago

  • Project changed from Suivi des traces to w.c.s.
#2

Updated by Lauréline Guérin 10 months ago

sans doute corrigé par #90572

#3

Updated by Frédéric Péters 10 months ago

  • Status changed from Nouveau to Fermé

sans doute corrigé par #90572

Il me semble en effet que ça sera ok :

        if check_value_type and not isinstance(option_id, (int, str)):
            get_publisher().record_error(_('Invalid type for item lookup (%r)') % option_id) 
#4

Updated by Frédéric Péters 10 months ago

  • Related to Bug #90572: préremplissage d'un champ liste (sourcée sur des fiches) avec une liste (TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list') added

Also available in: Atom PDF