fix: values on local objects
This commit is contained in:
parent
de996c6ae6
commit
3e9b8a595f
@ -210,7 +210,7 @@ def send_email_on_notification(sender, instance, created, **kwargs):
|
|||||||
try:
|
try:
|
||||||
# local author
|
# local author
|
||||||
if instance.author.startswith(settings.SITE_URL):
|
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
|
# external author
|
||||||
else:
|
else:
|
||||||
who = requests.get(instance.author).json()['name']
|
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
|
# get identifier for resource triggering notification, and store in where
|
||||||
try:
|
try:
|
||||||
if instance.object.startswith(settings.SITE_URL):
|
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:
|
else:
|
||||||
where = requests.get(instance.object).json()['name']
|
where = requests.get(instance.object).json()['name']
|
||||||
except:
|
except:
|
||||||
|
Loading…
Reference in New Issue
Block a user