data = j['event']['type'] + '@' + str(j['event']['time'])
calculated_signature = hmac.new(self.provider.config['webhookid'].encode(), data.encode(), hashlib.sha256).hexdigest()
if not hmac.compare_digest(j['event']['hash'], calculated_signature):
- return HttpResponse("Invalid signature", sstatus=400)
+ return HttpResponse("Invalid signature", status=400)
docid = j.get('data', {}).get('object', {}).get('id', None)
if docid:
},
)
if r.status_code != 200:
- return False, "Failed to get post (sstatus {}): {}".format(r.status_code, r.text)
+ return False, "Failed to get post (status {}): {}".format(r.status_code, r.text)
# We can't really check that there is at least one post returned, because there might
# be no posts available. But at least this way we have verified that the token is OK.
return True, ''