Project

General

Profile

Bug #85066

remonter une erreur sur un |filter_by appelé sur un objet invalide (plutôt que lever AttributeError: 'NoneType' object has no attribute 'filter_by')

Added by Sentry Io 6 months ago. Updated 5 months ago.

Status:
Fermé
Priority:
Normal
Target version:
-
Start date:
22 December 2023
Due date:
% Done:

0%

Estimated time:
Patch proposed:
No
Planning:
No

Description

{{cards|objects:"arbrefruitier"|filter_by:"arbre"|filter_value:"poirier"|first|get:"max"|subtract:cards|objects:"arbrefruitier"|filter_by:"arbre"|filter_value:"poirier"|first|get:"max" }}

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

AttributeError: 'NoneType' object has no attribute 'filter_by'
(18 additional frame(s) were not displayed)
...
  File "django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "django/template/base.py", line 988, in render
    output = self.filter_expression.resolve(context)
  File "django/template/base.py", line 698, in resolve
    new_obj = func(obj, *arg_vals)
  File "wcs/qommon/templatetags/qommon.py", line 818, in filter_by
    return queryset.filter_by(unlazy(attribute))

Related issues

Related to w.c.s. - Bug #77907: logguer une erreur et passer son chemin sur un problème de gabarit (AttributeError: 'LazyFieldVar' object has no attribute 'apply_gte')Fermé25 May 2023

Actions

Associated revisions

Revision e6ddbd14 (diff)
Added by Frédéric Péters 5 months ago

misc: report error when queryset filters are called on invalid object (#85066)

History

#1

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

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

Updated by Robot Gitea 6 months ago

  • Status changed from Nouveau to En cours
  • Assignee set to Frédéric Péters

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

#3

Updated by Robot Gitea 5 months ago

  • Status changed from En cours to Solution proposée
#4

Updated by Robot Gitea 5 months ago

  • Status changed from Solution proposée to Solution validée

Paul Marillonnet (pmarillonnet) a approuvé une pull request sur Gitea concernant cette demande :

#5

Updated by Robot Gitea 5 months ago

  • Status changed from Solution validée to Résolu (à déployer)

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

#6

Updated by Transition automatique 5 months ago

  • Status changed from Résolu (à déployer) to Solution déployée
#7

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

  • Related to Bug #77907: logguer une erreur et passer son chemin sur un problème de gabarit (AttributeError: 'LazyFieldVar' object has no attribute 'apply_gte') added
#8

Updated by Transition automatique 3 months ago

Automatic expiration

Also available in: Atom PDF