From d9de265de9acff49c21bdec0685acedad24aae12 Mon Sep 17 00:00:00 2001 From: Benjamin Bach Date: Mon, 22 Jul 2024 16:49:24 +0200 Subject: [PATCH] Fix some admin columms --- src/accounting/admin.py | 7 +------ src/accounting/models.py | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/accounting/admin.py b/src/accounting/admin.py index a970e9a..efdfb38 100644 --- a/src/accounting/admin.py +++ b/src/accounting/admin.py @@ -43,12 +43,7 @@ class OrderAdmin(admin.ModelAdmin): inlines = (OrderProductInline,) form = OrderAdminForm - list_display = ("who", "description", "created", "is_paid") - - @admin.display(description=_("Customer")) - def who(self, instance: models.Order) -> str: - """Return the full name of the user who made the order.""" - return instance.member.get_full_name() + list_display = ("member", "description", "created", "is_paid") @admin.register(models.Payment) diff --git a/src/accounting/models.py b/src/accounting/models.py index f92e4fc..d4cd2b0 100644 --- a/src/accounting/models.py +++ b/src/accounting/models.py @@ -32,7 +32,7 @@ class Account(CreatedModifiedAbstract): owner = models.ForeignKey("membership.Member", on_delete=models.PROTECT) def __str__(self) -> str: - return f"Account of {self.owner.get_full_name()}" + return f"Account of {self.owner}" @property def balance(self) -> Money: