fix: resolve Django Admin 500 error on scheduled tasks list

This commit is contained in:
Karl Determe 2026-08-04 11:12:13 +02:00
parent bec7153b7a
commit 9806175619

View file

@ -331,12 +331,8 @@ StreetUp - Système de tâches planifiées
def is_active_display(self, obj): def is_active_display(self, obj):
"""Affiche le statut avec une icône.""" """Affiche le statut avec une icône."""
if obj.is_active: if obj.is_active:
return format_html( return mark_safe('<span style="color: green;">✓ Active</span>')
'<span style="color: green;">✓ Active</span>' return mark_safe('<span style="color: red;">✗ Inactive</span>')
)
return format_html(
'<span style="color: red;">✗ Inactive</span>'
)
is_active_display.short_description = "Statut" is_active_display.short_description = "Statut"
def last_run_display(self, obj): def last_run_display(self, obj):
@ -580,8 +576,8 @@ class CommandExecutionLogAdmin(admin.ModelAdmin):
def email_sent_display(self, obj): def email_sent_display(self, obj):
"""Affiche si l'email a été envoyé.""" """Affiche si l'email a été envoyé."""
if obj.email_sent: if obj.email_sent:
return format_html('<span style="color: green;">✓</span>') return mark_safe('<span style="color: green;">✓</span>')
return format_html('<span style="color: gray;">-</span>') return mark_safe('<span style="color: gray;">-</span>')
email_sent_display.short_description = "Email" email_sent_display.short_description = "Email"
def output_formatted(self, obj): def output_formatted(self, obj):