From 3e9b8a595f6707a7ad43e54fc85d6f412c6bbe50 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Pasquier <contact@jbpasquier.eu>
Date: Fri, 26 Mar 2021 19:11:20 +0100
Subject: [PATCH] fix: values on local objects

---
 djangoldp_notification/models.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/djangoldp_notification/models.py b/djangoldp_notification/models.py
index 6a23f30..c1ba2a0 100644
--- a/djangoldp_notification/models.py
+++ b/djangoldp_notification/models.py
@@ -210,7 +210,7 @@ def send_email_on_notification(sender, instance, created, **kwargs):
         try:
             # local author
             if instance.author.startswith(settings.SITE_URL):
-                who = str(Model.resolve_id(instance.author.replace(settings.SITE_URL, '')))
+                who = str(Model.resolve_id(instance.author.replace(settings.SITE_URL, '')).get_full_name())
             # external author
             else:
                 who = requests.get(instance.author).json()['name']
@@ -220,7 +220,7 @@ def send_email_on_notification(sender, instance, created, **kwargs):
         # get identifier for resource triggering notification, and store in where
         try:
             if instance.object.startswith(settings.SITE_URL):
-                where = str(Model.resolve_id(instance.object.replace(settings.SITE_URL, '')))
+                where = str(Model.resolve_id(instance.object.replace(settings.SITE_URL, '')).name)
             else:
                 where = requests.get(instance.object).json()['name']
         except:
-- 
GitLab