Bug #8030
custom_user: fix left join query to get user roles and direct relationship status
Début:
06 août 2015
Echéance:
% réalisé:
100%
Temps estimé:
Patch proposed:
Non
Planning:
Description
Current query does not produce the wanted join i.e.
LEFT JOIN a2_rbac_role_members ON (a2_rbac_role_members.role_id = a2_rbac_role.id AND a2_rbac_role_members.user_id = <self.id>)
So instead of testing that "a2_rbac_role_members IS NOT NULL" since we cannot get the join we want, we make a prefetch_related() request on the members relation restricting it to the current user only.
Révisions associées
Historique
Mis à jour par Benjamin Dauvergne il y a plus de 8 ans
- Statut changé de Nouveau à Résolu (à déployer)
- % réalisé changé de 0 à 100
Appliqué par commit authentic2|05c7842646228dcf5bc446355b15f608fe5f5d02.
Mis à jour par Benjamin Dauvergne il y a environ 8 ans
- Statut changé de Résolu (à déployer) à Solution déployée
Mis à jour par Benjamin Dauvergne il y a plus de 6 ans
- Statut changé de Solution déployée à Fermé
custom_user: fix left join query to get user roles and direct relationship status (fixes #8030)
Current query does not produce the wanted join i.e.
So instead of testing that "a2_rbac_role_members IS NOT NULL" since we
cannot get the join we want, we make a prefetch_related() request on the
members relation restricting it to the current user only.