Commit 89dc52ae by Kálmán Viktor

dashboard: better group filtering in profile

parent c294526f
...@@ -2671,9 +2671,8 @@ class ProfileView(LoginRequiredMixin, DetailView): ...@@ -2671,9 +2671,8 @@ class ProfileView(LoginRequiredMixin, DetailView):
group_profiles = GroupProfile.get_objects_with_level( group_profiles = GroupProfile.get_objects_with_level(
"operator", self.request.user) "operator", self.request.user)
groups = Group.objects.filter(groupprofile__in=group_profiles) groups = Group.objects.filter(groupprofile__in=group_profiles)
context['groups'] = [ context['groups'] = self.get_object().groups.filter(
g for g in self.get_object().groups.all() if g in groups pk__in=groups)
]
# permissions # permissions
# show groups only if the user is superuser, or have access # show groups only if the user is superuser, or have access
......
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 sign in to comment