membershipworks: Add event instructor name to EventInvoice list_display
All checks were successful
Ruff / ruff (push) Successful in 29s
Test / test (push) Successful in 4m5s

This commit is contained in:
Adam Goldsmith 2024-05-24 11:38:05 -04:00
parent 229558116b
commit b1d3f16459

View File

@ -123,6 +123,7 @@ class EventInvoiceAdmin(admin.ModelAdmin):
"event", "event",
"_event_start", "_event_start",
"_event_end", "_event_end",
"_event_instructor",
"date_submitted", "date_submitted",
"date_paid", "date_paid",
"amount", "amount",
@ -141,6 +142,10 @@ class EventInvoiceAdmin(admin.ModelAdmin):
] ]
date_hierarchy = "date_submitted" date_hierarchy = "date_submitted"
@admin.display(ordering="event__instructor")
def _event_instructor(self, obj):
return obj.event.instructor
@admin.display(ordering="event__start") @admin.display(ordering="event__start")
def _event_start(self, obj): def _event_start(self, obj):
return obj.event.start return obj.event.start