From 4f55d1b7e353643a954814b7b5740c30119315c0 Mon Sep 17 00:00:00 2001 From: Michael Krause Date: Sat, 6 Oct 2018 17:04:01 +0200 Subject: [PATCH] UserList: do not duplicate user names --- users/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/users/views.py b/users/views.py index 4bc50fab..243b4b85 100644 --- a/users/views.py +++ b/users/views.py @@ -50,9 +50,9 @@ def get_queryset(self): self.departmentfilter = self.kwargs.get("department", "all") if self.departmentfilter != "all" and self.departmentfilter != "my": - users = users.filter(departments__id=self.departmentfilter) + users = users.filter(departments__id=self.departmentfilter).distinct() elif self.departmentfilter == "my": - users = users.filter(departments__in=self.request.user.departments.all()) + users = users.filter(departments__in=self.request.user.departments.all()).distinct() # filter by given filter string if self.filterstring != "":