remove dict from Trackers

pull/586/head
TonyJabbour 2021-09-28 22:56:28 +02:00
parent 2e880c79ca
commit ecc16d1004
3 changed files with 3 additions and 3 deletions

View File

@ -95,7 +95,7 @@ class Tracker_Regex(AbstractModule):
NotificationHelper.sendEmailNotification(mail, mail_subject, mail_body) NotificationHelper.sendEmailNotification(mail, mail_subject, mail_body)
webhook_to_post = Term.get_term_webhook(tracker_uuid) webhook_to_post = Term.get_term_webhook(tracker_uuid)
if webhook_to_post: if webhook_to_post:
request_body = dict({"itemId": item_id, "url": self.full_item_url, "type": "REGEX"}) request_body = {"itemId": item_id, "url": self.full_item_url, "type": "REGEX"}
r = requests.post(webhook_to_post, data=request_body) r = requests.post(webhook_to_post, data=request_body)
if (r.status_code >= 400): if (r.status_code >= 400):
raise Exception(f"Webhook request failed for {webhook_to_post}\nReason: {r.reason}") raise Exception(f"Webhook request failed for {webhook_to_post}\nReason: {r.reason}")

View File

@ -141,7 +141,7 @@ class Tracker_Term(AbstractModule):
webhook_to_post = Term.get_term_webhook(term_uuid) webhook_to_post = Term.get_term_webhook(term_uuid)
if webhook_to_post: if webhook_to_post:
request_body = dict({"itemId": item_id, "url": self.full_item_url, "type": "Term", "term": term}) request_body = {"itemId": item_id, "url": self.full_item_url, "type": "Term", "term": term}
r = requests.post(webhook_to_post, data=request_body) r = requests.post(webhook_to_post, data=request_body)
if (r.status_code >= 400): if (r.status_code >= 400):
raise Exception(f"Webhook request failed for {webhook_to_post}\nReason: {r.reason}") raise Exception(f"Webhook request failed for {webhook_to_post}\nReason: {r.reason}")

View File

@ -98,7 +98,7 @@ class Tracker_Yara(AbstractModule):
NotificationHelper.sendEmailNotification(mail, mail_subject, mail_body) NotificationHelper.sendEmailNotification(mail, mail_subject, mail_body)
webhook_to_post = Term.get_term_webhook(tracker_uuid) webhook_to_post = Term.get_term_webhook(tracker_uuid)
if webhook_to_post: if webhook_to_post:
request_body = dict({"itemId": item_id, "url": self.full_item_url, "type": "YARA"}) request_body = {"itemId": item_id, "url": self.full_item_url, "type": "YARA"}
r = requests.post(webhook_to_post, data=request_body) r = requests.post(webhook_to_post, data=request_body)
if (r.status_code >= 400): if (r.status_code >= 400):
raise Exception(f"Webhook request failed for {webhook_to_post}\nReason: {r.reason}") raise Exception(f"Webhook request failed for {webhook_to_post}\nReason: {r.reason}")