From 0ff170d7ff1e855bb6977802d3d8e92ba675c0f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Tue, 26 Mar 2024 09:35:44 -0300 Subject: [PATCH] =?UTF-8?q?Permitir=20limpar=20log=20de=20execu=C3=A7?= =?UTF-8?q?=C3=A3o=20de=20jobs=20manualmente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/utils/admin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sigi/apps/utils/admin.py b/sigi/apps/utils/admin.py index 87558a5..268c1c0 100644 --- a/sigi/apps/utils/admin.py +++ b/sigi/apps/utils/admin.py @@ -186,7 +186,10 @@ class JobScheduleAdmin(admin.ModelAdmin): return False def has_delete_permission(self, request, obj=None): - return False + if obj is None or obj.status == JobSchedule.STATUS_CONCLUIDO: + return super().has_delete_permission(request, obj) + else: + return False def has_change_permission(self, request, obj=None): return False