diff --git a/backend/contributions/admin.py b/backend/contributions/admin.py index 846844e..4f227ca 100644 --- a/backend/contributions/admin.py +++ b/backend/contributions/admin.py @@ -733,12 +733,13 @@ def text_preview(self, obj): def get_status(self, obj): from django.utils import timezone as tz + from django.utils.safestring import mark_safe now = tz.now() if not obj.is_active: - return format_html(' Inactive') + return mark_safe(' Inactive') if obj.start_date and now < obj.start_date: - return format_html(' Scheduled') + return mark_safe(' Scheduled') if obj.end_date and now > obj.end_date: - return format_html(' Expired') - return format_html(' Active') + return mark_safe(' Expired') + return mark_safe(' Active') get_status.short_description = 'Status'