From bf29efda0a526dd01c513f1f30a7d16c28ccf859 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Thu, 8 Oct 2020 10:36:23 +0200 Subject: [PATCH] Display real user name in the Soge credits list/detail --- apps/treasury/tables.py | 2 +- .../treasury/templates/treasury/sogecredit_detail.html | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/treasury/tables.py b/apps/treasury/tables.py index 9a72ecf3..44415061 100644 --- a/apps/treasury/tables.py +++ b/apps/treasury/tables.py @@ -147,4 +147,4 @@ class SogeCreditTable(tables.Table): class Meta: model = SogeCredit - fields = ('user', 'amount', 'valid', ) + fields = ('user', 'user__last_name', 'user__first_name', 'amount', 'valid', ) diff --git a/apps/treasury/templates/treasury/sogecredit_detail.html b/apps/treasury/templates/treasury/sogecredit_detail.html index 994aca08..bcdd7c5f 100644 --- a/apps/treasury/templates/treasury/sogecredit_detail.html +++ b/apps/treasury/templates/treasury/sogecredit_detail.html @@ -11,8 +11,14 @@ SPDX-License-Identifier: GPL-3.0-or-later
-
{% trans 'user'|capfirst %}
-
{{ object.user }}
+
{% trans 'last name'|capfirst %}
+
{{ object.user.last_name }}
+ +
{% trans 'first name'|capfirst %}
+
{{ object.user.first_name }}
+ +
{% trans 'username'|capfirst %}
+
{{ object.user.username }}
{% if "note.view_note_balance"|has_perm:object.user.note %}
{% trans 'balance'|capfirst %}