Commit 89dc52ae by Kálmán Viktor

dashboard: better group filtering in profile

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