Bug #64497
/api/notification/add/ , TypeError: Cannot cast AnonymousUser to int. Are you trying to use it in place of User?
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
notifications: do not notify anonymous user (#64497)
Historique
Mis à jour par Frédéric Péters il y a presque 2 ans
- Fichier 0001-notifications-do-not-notify-anonymous-user-64497.patch 0001-notifications-do-not-notify-anonymous-user-64497.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
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.
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)
Mis à jour par Transition automatique il y a presque 2 ans
- Statut changé de Résolu (à déployer) à Solution déployée
notifications: rename "founded_uuids" to "existing_uuids" (#64497)