Skip to content
Snippets Groups Projects
Commit 3e9b8a59 authored by Jean-Baptiste Pasquier's avatar Jean-Baptiste Pasquier
Browse files

fix: values on local objects

parent de996c6a
No related branches found
Tags v2.2.5
No related merge requests found
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment