Projet

Général

Profil

Bug #64497

/api/notification/add/ , TypeError: Cannot cast AnonymousUser to int. Are you trying to use it in place of User?

Ajouté par Sentry Io il y a environ 2 ans. Mis à jour il y a presque 2 ans.

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

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

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

TypeError: Cannot cast AnonymousUser to int. Are you trying to use it in place of User?
(18 additional frame(s) were not displayed)
...
  File "django/db/models/sql/query.py", line 1116, in build_lookup
    lookup = lookup_class(lhs, rhs)
  File "django/db/models/lookups.py", line 20, in __init__
    self.rhs = self.get_prep_lookup()
  File "django/db/models/fields/related_lookups.py", line 115, in get_prep_lookup
    self.rhs = target_field.get_prep_value(self.rhs)
  File "django/db/models/fields/__init__.py", line 972, in get_prep_value
    return int(value)
  File "django/contrib/auth/models.py", line 388, in __int__
    raise TypeError('Cannot cast AnonymousUser to int. Are you trying to use it in place of User?')

Fichiers

Révisions associées

Révision cd71255a (diff)
Ajouté par Frédéric Péters il y a presque 2 ans

notifications: rename "founded_uuids" to "existing_uuids" (#64497)

Révision ed358aed (diff)
Ajouté par Frédéric Péters il y a presque 2 ans

notifications: do not notify anonymous user (#64497)

Historique

#1

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

  • Projet changé de Suivi des traces à Combo
#2

Mis à jour par Frédéric Péters il y a presque 2 ans

  • Assigné à mis à Frédéric Péters
#3

Mis à jour par Frédéric Péters il y a presque 2 ans

#4

Mis à jour par Thomas Noël il y a presque 2 ans

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

Et ça clarifie le code, parfait.

#5

Mis à jour par Frédéric Péters il y a presque 2 ans

  • Statut changé de Solution validée à Résolu (à déployer)
commit ed358aed7e967f351e75e6b90d9fb3cabe689aac
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Mon May 23 15:27:16 2022 +0200

    notifications: do not notify anonymous user (#64497)

commit cd71255ae547fdbf41a30013abc5526ac1579012
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Mon May 23 15:15:10 2022 +0200

    notifications: rename "founded_uuids" to "existing_uuids" (#64497)
#6

Mis à jour par Transition automatique il y a presque 2 ans

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

Mis à jour par Transition automatique il y a presque 2 ans

Automatic expiration

Formats disponibles : Atom PDF