bugfix: improve subscription system

This commit is contained in:
Matthieu Fesselier 2019-03-06 17:13:05 +07:00
parent efb334ebc4
commit 5352ba938a
1 changed files with 2 additions and 2 deletions

View File

@ -51,11 +51,11 @@ def send_notification(sender, instance, **kwargs):
process = Thread(target=send_request, args=[subscription.inbox, url])
process.start()
threads.append(process)
def send_request(target, object):
def send_request(target, objectIri):
try:
req=requests.post(target,
json={"@context":"https://cdn.happy-dev.fr/owl/hdcontext.jsonld",
"object": object, "type": "system", "read": False},
"object": objectIri, "type": "update"},
headers={"Content-Type": "application/ld+json"})
except:
logging.error('Djangoldp_notifications: Error with request')