Projet

Général

Profil

Bug #75716

TypeError: Object of type NamedAttachmentsSubstitutionProxy is not JSON serializable

Ajouté par Sentry Io il y a environ un an. Mis à jour il y a environ un an.

Statut:
Fermé
Priorité:
Normal
Version cible:
-
Début:
22 mars 2023
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Non
Planning:
Non

Description

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

TypeError: Object of type NamedAttachmentsSubstitutionProxy is not JSON serializable
(24 additional frame(s) were not displayed)
...
  File "wcs/qommon/misc.py", line 602, in encode
    return super().encode(preprocess_struct_time(o))
  File "json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "wcs/qommon/misc.py", line 643, in default
    return json.JSONEncoder.default(self, o)
  File "json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '

Révisions associées

Révision 0a5be728 (diff)
Ajouté par Serghei Mihai (congés, retour 15/05) il y a environ un an

workflows: implement json serialization of files attached in evolutions (#75716)

Historique

#1

Mis à jour par Serghei Mihai (congés, retour 15/05) il y a environ un an

  • Projet changé de Suivi des traces à w.c.s.
#3

Mis à jour par Frédéric Péters il y a environ un an

(paramètre {{form_attachments_xxx}})

→ ajouter une propriété base_filename et une méthode get_content à AttachmentSubstitutionProxy (pour que ça soit géré par le code actuel de sérialisation json,

        if hasattr(o, 'base_filename'):
            return {
                'filename': o.base_filename,
                'content_type': o.content_type or 'application/octet-stream',
                'content': base64.b64encode(o.get_content()),
            }
#4

Mis à jour par Robot Gitea il y a environ un an

  • Statut changé de Nouveau à En cours
  • Assigné à mis à Serghei Mihai (congés, retour 15/05)

Serghei Mihai (smihai) a ouvert une pull request sur Gitea concernant cette demande :

#5

Mis à jour par Robot Gitea il y a environ un an

  • Statut changé de En cours à Solution proposée
#6

Mis à jour par Robot Gitea il y a environ un an

  • Statut changé de Solution proposée à Solution validée

Frédéric Péters (fpeters) a approuvé une pull request sur Gitea concernant cette demande :

#7

Mis à jour par Robot Gitea il y a environ un an

  • Statut changé de Solution validée à Résolu (à déployer)

Serghei Mihai (smihai) a mergé une pull request sur Gitea concernant cette demande :

#8

Mis à jour par Transition automatique il y a environ un an

  • Statut changé de Résolu (à déployer) à Solution déployée
#9

Mis à jour par Transition automatique il y a 12 mois

Automatic expiration

Formats disponibles : Atom PDF