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 != "":