Commit 1d6942d4 authored by HERBERT Ryan's avatar HERBERT Ryan

VidjilAuth another issue related to the queries when no group_assoc exists....

VidjilAuth another issue related to the queries when no group_assoc exists. The query has been split to resolve this
parent 81bf70a4
......@@ -417,13 +417,16 @@ class VidjilAuth(Auth):
user = self.user_id
group_list = db(
(db.auth_membership.user_id == user) &
((db.auth_membership.group_id == db.auth_group.id) |
((db.auth_membership.group_id == db.group_assoc.second_group_id) &
(db.group_assoc.first_group_id == db.auth_group.id)))
(db.auth_membership.group_id == db.auth_group.id)
).select(db.auth_group.id, db.auth_group.role, groupby=db.auth_group.id)
parent_list = db(
(db.auth_membership.user_id == user) &
(db.auth_membership.group_id == db.group_assoc.second_group_id) &
(db.group_assoc.first_group_id == db.auth_group.id)
).select(db.auth_group.id, db.auth_group.role, groupby=db.auth_group.id)
return group_list
return group_list + parent_list
def vidjil_accessible_query(self, name, table, user_id=None):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment