From d2542060a1f32c020bd6163aafc2c6231052c10d Mon Sep 17 00:00:00 2001 From: moanos Date: Fri, 22 Nov 2024 18:50:46 +0100 Subject: [PATCH] feat: Allow to bulk-activate ANs in the admin interface --- src/fellchensammlung/admin.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/fellchensammlung/admin.py b/src/fellchensammlung/admin.py index ff9051e..eba175d 100644 --- a/src/fellchensammlung/admin.py +++ b/src/fellchensammlung/admin.py @@ -24,6 +24,13 @@ class AdoptionNoticeAdmin(admin.ModelAdmin): inlines = [ StatusInline, ] + actions = ("activate",) + + def activate(self, request, queryset): + for obj in queryset: + obj.set_active() + + activate.short_description = _("Ausgewählte Vermittlungen aktivieren") # Re-register UserAdmin