Projet

Général

Profil

Bug #71197

statistiques, crash sur un appel nombre de fiches sans regroupement temporel

Ajouté par Sentry Io il y a plus d'un an. Mis à jour il y a plus d'un an.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
Début:
09 novembre 2022
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

Précision également, ça concerne un regroupement sur une liste à choix multiples.

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

TypeError: unhashable type: 'list'
(3 additional frame(s) were not displayed)
...
  File "django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "wcs/statistics/views.py", line 38, in dispatch
    return super().dispatch(*args, **kwargs)
  File "django/views/generic/base.py", line 97, in dispatch
    return handler(request, *args, **kwargs)
  File "wcs/statistics/views.py", line 250, in get
    x_labels = [group_labels.get(x[0], x[0]) for x in totals]
  File "wcs/statistics/views.py", line 250, in <listcomp>
    x_labels = [group_labels.get(x[0], x[0]) for x in totals]

Fichiers

Révisions associées

Révision 6b54032b (diff)
Ajouté par Valentin Deniaud il y a plus d'un an

statistics: support group by items field without time interval (#71197)

Historique

#1

Mis à jour par Valentin Deniaud il y a plus d'un an

  • Projet changé de Suivi des traces à w.c.s.
  • Description mis à jour (diff)
  • Assigné à mis à Valentin Deniaud
#2

Mis à jour par Valentin Deniaud il y a plus d'un an

C'est un bug qui concerne indifféremment fiches et formulaires, par contre le combo pas de regroupement temporel + liste à choix multiple est effectivement le coupable.

J'ai oublié ce cas dans #63377, d'ailleurs la partie

-        if 'group_by' not in totals_kwargs:
-            x_labels = [x[0] for x in totals]
+        if time_interval == 'none' or 'group_by' not in totals_kwargs:
+            x_labels = [group_labels.get(x[0], x[0]) for x in totals]

introduite par le 0002 est foireuse, c'est mélanger torchons et serviettes, je reviens dessus dans ce patch en traitant bien le nouveau cas time_interval == 'none' séparément.

#3

Mis à jour par Valentin Deniaud il y a plus d'un an

  • Tracker changé de Development à Bug
#6

Mis à jour par Benjamin Dauvergne il y a plus d'un an

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

Mis à jour par Valentin Deniaud il y a plus d'un an

  • Statut changé de Solution validée à Résolu (à déployer)
commit f6c54069168c14d27c4f88c1b3a28c1893fd2a76
Author: Valentin Deniaud <vdeniaud@entrouvert.com>
Date:   Wed Nov 9 18:04:55 2022 +0100

    statistics: support group by items field without time interval (#71197)
#8

Mis à jour par Transition automatique il y a plus d'un an

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

Mis à jour par Transition automatique il y a plus d'un an

Automatic expiration

Formats disponibles : Atom PDF