From e91e99eb5d2d6329403e7d279638fbff7f424c0d Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 4 Mar 2025 16:31:31 +0100 Subject: ✨ admin: add person ID to gdpr persons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/models.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index a7c7626dd..bb7cee9ac 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -3400,7 +3400,7 @@ class GDPRPerson(models.Model): verbose_name_plural = _("GDPR - Persons") def __str__(self): - return self.raw_name + return f"{self.raw_name} [{self.id}]" class GDPRLog(models.Model): @@ -3429,11 +3429,12 @@ class GDPRLog(models.Model): @property def persons_lbl(self): - return " ; ".join( + return " ; ".join([ + f"{name} [{idx}]" for name, idx in self.persons.through.objects.filter( gdprlog_id=self.pk - ).values_list("gdprperson__raw_name", flat=True) - ) + ).values_list("gdprperson__raw_name", "gdprperson__id") + ]) def __str__(self): return f"{self.user.username} - {self.date} - {self.activity_lbl}" -- cgit v1.2.3