From e0c3bc1b71f1c1fe50d2656cc60814daf93f99ee Mon Sep 17 00:00:00 2001
From: Andreas Hubel <andi@saerdnaer.de>
Date: Mon, 25 Dec 2023 02:01:22 +0100
Subject: [PATCH] fix person attribute mappings

---
 src/api/schedule.py      | 8 ++++----
 src/core/models/users.py | 7 ++++++-
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/api/schedule.py b/src/api/schedule.py
index 65ad5f1a1..fb6caa962 100644
--- a/src/api/schedule.py
+++ b/src/api/schedule.py
@@ -117,8 +117,8 @@ class ScheduleEncoder(json.JSONEncoder):
                 'public_name': name,
                 'avatar': p.avatar_url,
                 'biography': member.description if member else None,
-                # 'links': person.links,  # TODO
-                # 'url': p.get_absolute_url(),
+                # 'links': p.links,  # TODO
+                'url': p.get_absolute_url(),
             }
 
         if isinstance(p, EventParticipant):
@@ -131,8 +131,8 @@ class ScheduleEncoder(json.JSONEncoder):
                 'public_name': name,
                 'avatar': p.participant.avatar_url,
                 'biography': member.description if member else '',
-                # 'links': person.participant.links,  # TODO
-                # 'url': p.participant.get_absolute_url(),
+                # 'links': p.participant.links,  # TODO
+                'url': p.participant.get_absolute_url(),
             }
 
         # we assume it is a dict, but we normally should never get here
diff --git a/src/core/models/users.py b/src/core/models/users.py
index 37cb8fcb1..1fdc66f97 100644
--- a/src/core/models/users.py
+++ b/src/core/models/users.py
@@ -222,6 +222,11 @@ class PlatformUser(AbstractUser):
         except ObjectDoesNotExist:
             return None
 
+    def get_absolute_url(self):
+        from core.templatetags.hub_absolute import hub_absolute
+
+        return hub_absolute('plainui:user', user_slug=self.slug, i18n=False)
+
     def get_character_layers(self):
         info = self.avatar_config or {}
         return info.get('character_layers', [])
@@ -372,7 +377,7 @@ class PlatformUser(AbstractUser):
 
         # join the new user into the conference
         cm, _ = conference.users.get_or_create(user=obj)
-        cm.description = data.get('description')
+        cm.description = data.get('biography', '')
         cm.save()
 
         # add all known addresses as (unverified and non-public) communication channels
-- 
GitLab