комит
This commit is contained in:
@@ -332,6 +332,8 @@ class SubscriptionAdmin(admin.ModelAdmin):
|
||||
|
||||
def days_left_display(self, obj):
|
||||
"""Отображение оставшихся дней"""
|
||||
if not obj or not obj.expires_at:
|
||||
return "—"
|
||||
days = obj.days_left()
|
||||
if days == 0:
|
||||
return format_html('<span style="color: red;">Истекла</span>')
|
||||
@@ -344,6 +346,8 @@ class SubscriptionAdmin(admin.ModelAdmin):
|
||||
|
||||
def is_expired_display(self, obj):
|
||||
"""Отображение статуса истечения"""
|
||||
if not obj or not obj.expires_at:
|
||||
return "—"
|
||||
if obj.is_expired():
|
||||
return format_html('<span style="color: red;">Да</span>')
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user