0001-provisionning-use-explicit-__in-lookup-25646.patch
hobo/agent/authentic2/provisionning.py | ||
---|---|---|
105 | 105 |
# Find roles giving a superuser attribute |
106 | 106 |
# If there is any role of this kind, we do one provisionning message for each user and |
107 | 107 |
# each service. |
108 |
roles_with_attributes = (self.Role.objects.filter(members=users) |
|
108 |
roles_with_attributes = (self.Role.objects.filter(members__in=users)
|
|
109 | 109 |
.parents(include_self=True) |
110 | 110 |
.filter(attributes__name='is_superuser') |
111 | 111 |
.exists()) |
... | ... | |
115 | 115 |
roles = dict((r.id, r) for r in all_roles) |
116 | 116 |
user_roles = {} |
117 | 117 |
parents = {} |
118 |
for rp in self.RoleParenting.objects.filter(child=all_roles): |
|
118 |
for rp in self.RoleParenting.objects.filter(child__in=all_roles):
|
|
119 | 119 |
parents.setdefault(rp.child.id, []).append(rp.parent.id) |
120 | 120 |
Through = self.Role.members.through |
121 |
for u_id, r_id in Through.objects.filter(role__members=users).values_list('user_id', |
|
121 |
for u_id, r_id in Through.objects.filter(role__members__in=users).values_list('user_id',
|
|
122 | 122 |
'role_id'): |
123 | 123 |
user_roles.setdefault(u_id, set()).add(roles[r_id]) |
124 | 124 |
for p_id in parents.get(r_id, []): |
125 |
- |