Projet

Général

Profil

Bug #51728

crash sur un label de champ commentaire à None

Ajouté par Frédéric Péters il y a environ 3 ans. Mis à jour il y a environ 3 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
Début:
05 mars 2021
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

(il faudrait idéalement trouver comment c'est arrivé mais je suspecte des manipulations moches sur des imports/exports)

Exception:
  type = '<class 'TypeError'>', value = 'expected string or bytes-like object'

Stack trace (most recent call first):
  File "/usr/lib/python3.7/re.py", line 192, in sub
   190     a callable, it's passed the Match object and must return
   191     a replacement string to be used.""" 
>  192     return _compile(pattern, flags).sub(repl, string, count)
   193
   194 def subn(pattern, repl, string, count=0, flags=0):

  locals:
     count = 0
     flags = 0
     pattern = '<.*?>'
     repl = ' '
     string = None

  File "/usr/lib/python3/dist-packages/wcs/fields.py", line 257, in unhtmled_label
   255     @property
   256     def unhtmled_label(self):
>  257         return force_str(html.unescape(force_text(re.sub('<.*?>', ' ', self.label))).strip())
   258
   259     def get_admin_attributes(self):

  locals:
     self = <CommentField 27 None>

  File "/usr/lib/python3/dist-packages/wcs/admin/fields.py", line 307, in _q_index
   305                 type_label = field.get_type_label()
   306                 if field.type in ('subtitle', 'title', 'comment'):
>  307                     label = misc.ellipsize(field.unhtmled_label, 60)
   308                     if field.type in ('subtitle', 'title'):
   309                         r += htmltext('<strong id="label%s">%s</strong>') % (field.id, label)

  locals:
     current_page_no = 2
     extra_classes = ['multipage']
     field = <CommentField 27 None>

Fichiers

Révisions associées

Révision c72cc12a (diff)
Ajouté par Lauréline Guérin il y a environ 3 ans

backoffice: fix fields page when a field label is None (#51728)

Historique

#1

Mis à jour par Lauréline Guérin il y a environ 3 ans

  • Assigné à mis à Lauréline Guérin
#2

Mis à jour par Lauréline Guérin il y a environ 3 ans

#3

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

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

Mis à jour par Lauréline Guérin il y a environ 3 ans

  • Statut changé de Solution validée à Résolu (à déployer)
commit c72cc12a6ecadac6f264c744f8f58464ee0178b2
Author: Lauréline Guérin <zebuline@entrouvert.com>
Date:   Thu Mar 11 09:23:23 2021 +0100

    backoffice: fix fields page when a field label is None (#51728)
#5

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

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

Formats disponibles : Atom PDF