From 1e184776a44625a0491ad13d67e7d066646d2e18 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Mon, 29 Mar 2021 17:12:23 +0200 Subject: [PATCH] fix: target --- djangoldp_notification/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/djangoldp_notification/models.py b/djangoldp_notification/models.py index c1ba2a0..cb27de1 100644 --- a/djangoldp_notification/models.py +++ b/djangoldp_notification/models.py @@ -220,7 +220,10 @@ 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, '')).name) + if hasattr(Model.resolve_id(instance.object.replace(settings.SITE_URL, '')), 'get_full_name'): + where = Model.resolve_id(instance.object.replace(settings.SITE_URL, '')).get_full_name() + else: + where = str(Model.resolve_id(instance.object.replace(settings.SITE_URL, '')).name) else: where = requests.get(instance.object).json()['name'] except: