Projet

Général

Profil

Bug #28229

get_by_natural_key_json ne fixe pas le content_type des GenericForeignKey

Ajouté par Benjamin Dauvergne il y a plus de 5 ans. Mis à jour il y a plus de 5 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Catégorie:
-
Version cible:
-
Début:
21 novembre 2018
Echéance:
% réalisé:

100%

Temps estimé:
Patch proposed:
Oui
Planning:

Description

Vu sur ce build raté : https://jenkins2.entrouvert.org/job/authentic/236/testReport/junit/tests/test_natural_key/test_natural_key_json/

            assert nk == {
                'operation': op_nk,
                'ou': ou_nk,
                'target_ct': target_ct_nk,
                'target': target_nk,
            }
>           assert permission == Permission.objects.get_by_natural_key_json(nk)

génère cette requête retournant 2 permissions au lieu d'une:

kwargs = {'operation': <Operation: View>, 'ou__isnull': True, 'target_id': 46}
clone = <PermissionQueryset [<Permission: View / user>, <Permission: View / organizational unit / Default organizational unit>]>
num = 2

    def get(self, *args, **kwargs):

Il manque target_ct dans kwargs.


Fichiers

Révisions associées

Révision d8c6ba09 (diff)
Ajouté par Benjamin Dauvergne il y a plus de 5 ans

natural_key: fix ct_field of GenericForeignKey when looking for natural keys (fixes #28229)

Historique

#1

Mis à jour par Benjamin Dauvergne il y a plus de 5 ans

#2

Mis à jour par Emmanuel Cazenave il y a plus de 5 ans

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

Mis à jour par Benjamin Dauvergne il y a plus de 5 ans

  • Statut changé de Solution validée à Résolu (à déployer)
  • % réalisé changé de 0 à 100
#4

Mis à jour par Frédéric Péters il y a plus de 5 ans

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

Formats disponibles : Atom PDF