mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-15 23:32:17 +00:00
Show requestable groups on the group list, even if they're private
This commit is contained in:
@@ -24,6 +24,7 @@ def group_list(request):
|
|||||||
else:
|
else:
|
||||||
groups = Group.objects.select_related('groupinformation').filter(Q(groupinformation__type=GROUP_TYPE_PERMISSION) |
|
groups = Group.objects.select_related('groupinformation').filter(Q(groupinformation__type=GROUP_TYPE_PERMISSION) |
|
||||||
Q(groupinformation__public=True) |
|
Q(groupinformation__public=True) |
|
||||||
|
Q(groupinformation__requestable=True) |
|
||||||
Q(groupinformation__admins__in=[request.user]) |
|
Q(groupinformation__admins__in=[request.user]) |
|
||||||
Q(user__in=[request.user]))
|
Q(user__in=[request.user]))
|
||||||
|
|
||||||
@@ -43,7 +44,10 @@ def group_list(request):
|
|||||||
|
|
||||||
requestable = False
|
requestable = False
|
||||||
if group.groupinformation and group.groupinformation.requestable and not group.groupinformation.type == GROUP_TYPE_MANAGED:
|
if group.groupinformation and group.groupinformation.requestable and not group.groupinformation.type == GROUP_TYPE_MANAGED:
|
||||||
if not group.groupinformation.parent or group.groupinformation.parent in request.user.groups.all():
|
if group.groupinformation.parent:
|
||||||
|
if group.groupinformation.parent in request.user.groups.all():
|
||||||
|
requestable = True
|
||||||
|
else:
|
||||||
requestable = True
|
requestable = True
|
||||||
|
|
||||||
fixed = not group.groupinformation.type == GROUP_TYPE_PERMISSION
|
fixed = not group.groupinformation.type == GROUP_TYPE_PERMISSION
|
||||||
|
|||||||
Reference in New Issue
Block a user