fix: project duplicate when diff. way grant access
This commit is contained in:
parent
1e2ff3bd78
commit
6f4fad51ba
1 changed files with 1 additions and 1 deletions
|
@ -43,7 +43,7 @@ class ProjectMiddleware:
|
||||||
# access granted by specific permission
|
# access granted by specific permission
|
||||||
query |= Q(permissions__grantee_type=PermissionModel.GRANTEE_USER,
|
query |= Q(permissions__grantee_type=PermissionModel.GRANTEE_USER,
|
||||||
permissions__grantee_name=user.username)
|
permissions__grantee_name=user.username)
|
||||||
projects = Project.objects.filter(query)
|
projects = Project.objects.filter(query).distinct()
|
||||||
request.projects = projects
|
request.projects = projects
|
||||||
|
|
||||||
project = view_kwargs.get('project')
|
project = view_kwargs.get('project')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue