Development #50919
API find_duplicates : AttributeError: 'UsersAPI' object has no attribute 'patch'
Début:
05 février 2021
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Non
Description
https://sentry.entrouvert.org/entrouvert/publik/issues/29025/
AttributeError: 'UsersAPI' object has no attribute 'patch' (6 additional frame(s) were not displayed) ... File "rest_framework/views.py", line 495, in dispatch response = self.handle_exception(exc) File "authentic2/api_views.py", line 119, in handle_exception response = super(ExceptionHandlerMixin, self).handle_exception(exc) File "rest_framework/views.py", line 455, in handle_exception self.raise_uncaught_exception(exc) File "rest_framework/views.py", line 492, in dispatch response = handler(request, *args, **kwargs) File "authentic2/api_views.py", line 788, in put return self.patch(request, *args, **kwargs)
Fichiers
Révisions associées
Historique
Mis à jour par Frédéric Péters il y a environ 3 ans
- Projet changé de Suivi des traces à Authentic 2
- Sujet changé de AttributeError: 'UsersAPI' object has no attribute 'patch' à API find_duplicates : AttributeError: 'UsersAPI' object has no attribute 'patch'
Mis à jour par Benjamin Dauvergne il y a environ 3 ans
- Fichier 0001-api-do-not-clobber-HTTP-verb-methods-in-viewsets-509.patch 0001-api-do-not-clobber-HTTP-verb-methods-in-viewsets-509.patch ajouté
- Tracker changé de Bug à Development
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Et donc j'aurai appris aujourd'hui qu'il ne faut pas jouer avec les méthodes des verbes HTTP dans les ViewSet, il faut passer par les méthodes haut niveau qui sont mappés dessus (list, create, retrieve, update, partial_update, destroy), sinon ça casse le support des "extra_actions".
Mis à jour par Benjamin Dauvergne il y a environ 3 ans
Mis à jour par Serghei Mihai il y a environ 3 ans
- Statut changé de Solution proposée à En cours
Jenkins est rouge.
Mis à jour par Benjamin Dauvergne il y a environ 3 ans
- Fichier 0001-api-do-not-clobber-HTTP-verb-methods-in-viewsets-509.patch 0001-api-do-not-clobber-HTTP-verb-methods-in-viewsets-509.patch ajouté
- Statut changé de En cours à Solution proposée
Avec mise à jour des tests qui testaient que ça ne fonctionnait déjà pas comme on voulait que ça fonctionine (i.e. PUT := PATCH) :/
Mis à jour par Serghei Mihai il y a environ 3 ans
- Statut changé de Solution proposée à Solution validée
Mis à jour par Benjamin Dauvergne il y a environ 3 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit 09d8a676f94eeeb65f4b993a9993187f18072657 Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Fri Feb 5 17:43:34 2021 +0100 api: do not clobber HTTP verb methods in viewsets (#50919)
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
api: do not clobber HTTP verb methods in viewsets (#50919)