Fix some admin columms
Some checks failed
continuous-integration/drone/pr Build is failing

This commit is contained in:
Benjamin Bach 2024-07-22 16:49:24 +02:00
parent ee2ef48b96
commit d9de265de9
No known key found for this signature in database
GPG key ID: 486F0D69C845416E
2 changed files with 2 additions and 7 deletions

View file

@ -43,12 +43,7 @@ class OrderAdmin(admin.ModelAdmin):
inlines = (OrderProductInline,) inlines = (OrderProductInline,)
form = OrderAdminForm form = OrderAdminForm
list_display = ("who", "description", "created", "is_paid") list_display = ("member", "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()
@admin.register(models.Payment) @admin.register(models.Payment)

View file

@ -32,7 +32,7 @@ class Account(CreatedModifiedAbstract):
owner = models.ForeignKey("membership.Member", on_delete=models.PROTECT) owner = models.ForeignKey("membership.Member", on_delete=models.PROTECT)
def __str__(self) -> str: def __str__(self) -> str:
return f"Account of {self.owner.get_full_name()}" return f"Account of {self.owner}"
@property @property
def balance(self) -> Money: def balance(self) -> Money: