From de49f115405277b5974e03a81e1acc39218d5bf2 Mon Sep 17 00:00:00 2001 From: Rasmus Selsmark Date: Sun, 20 Aug 2023 14:24:28 +0200 Subject: [PATCH] =?UTF-8?q?Vis=20kun=20egne=20afdelinger=20p=C3=A5=C2=A0de?= =?UTF-8?q?ltager=20admin=20side?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- members/admin/activityparticipant_admin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/members/admin/activityparticipant_admin.py b/members/admin/activityparticipant_admin.py index 87dd0b4f..19e6235e 100644 --- a/members/admin/activityparticipant_admin.py +++ b/members/admin/activityparticipant_admin.py @@ -9,7 +9,6 @@ from members.models import ( Activity, AdminUserInformation, - Department, Union, ) @@ -23,7 +22,9 @@ class ActivityParticipantDepartmentFilter(admin.SimpleListFilter): def lookups(self, request, model_admin): return [ (str(department.pk), str(department)) - for department in Department.objects.all().order_by("name") + for department in AdminUserInformation.get_departments_admin( + request.user + ).order_by("name") ] def queryset(self, request, queryset):