From 68b68430616d76157c3f40a0affa7a702520984b Mon Sep 17 00:00:00 2001
From: Dominik George <dominik.george@teckids.org>
Date: Sat, 31 Aug 2019 22:07:07 +0200
Subject: [PATCH] Provide full_name property for persons.

---
 biscuit/core/models.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/biscuit/core/models.py b/biscuit/core/models.py
index e40b4e968..ef61eb5f7 100644
--- a/biscuit/core/models.py
+++ b/biscuit/core/models.py
@@ -105,9 +105,13 @@ class Person(SchoolRelated):
                                                      defaults={'name': value})
         self.primary_group = group
 
-    def __str__(self) -> str:
+    @property
+    def full_name(self) -> str:
         return '%s, %s' % (self.last_name, self.first_name)
 
+    def __str__(self) -> str:
+        return self.full_name
+
 
 class Group(SchoolRelated):
     """Any kind of group of persons in a school, including, but not limited
-- 
GitLab