Skip to content

Commit ed657d4

Browse files
committed
Set selected cronjob records to acknowleged status on Admin
1 parent d5ff4ff commit ed657d4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

api/admin.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,11 @@ class SituationReportTypeAdmin(CompareVersionAdmin):
756756
search_fields = ("type",)
757757

758758

759+
@admin.action(description="Set selected cronjob records to acknowleged status")
760+
def acknowledge(modeladmin, request, queryset):
761+
queryset.update(status=-2)
762+
763+
759764
class CronJobAdmin(CompareVersionAdmin):
760765
list_display = ("name", "created_at", "num_result", "status")
761766
search_fields = (
@@ -767,6 +772,7 @@ class CronJobAdmin(CompareVersionAdmin):
767772
"message_display",
768773
)
769774
list_filter = ("status", "name")
775+
actions = [acknowledge]
770776

771777
def message_display(self, obj):
772778
style_class = {

0 commit comments

Comments
 (0)