Oops, webhook not websocket

This commit is contained in:
Micah Lee 2021-04-11 13:49:51 -07:00
parent 29970d38ff
commit 84958ef7f3
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -108,7 +108,7 @@ class ReceiveModeWeb:
and not request.upload_error and not request.upload_error
and len(files) > 0 and len(files) > 0
): ):
self.send_websocket_notification(f"{len(files)} files uploaded") self.send_webhook_notification(f"{len(files)} files uploaded")
if request.upload_error: if request.upload_error:
self.common.log( self.common.log(
@ -181,8 +181,8 @@ class ReceiveModeWeb:
return self.web.error403() return self.web.error403()
return upload(ajax=True) return upload(ajax=True)
def send_websocket_notification(self, data): def send_webhook_notification(self, data):
self.common.log("ReceiveModeWeb", "send_websocket_notification", data) self.common.log("ReceiveModeWeb", "send_webhook_notification", data)
try: try:
requests.post( requests.post(
self.web.settings.get("receive", "webhook_url"), self.web.settings.get("receive", "webhook_url"),
@ -193,7 +193,7 @@ class ReceiveModeWeb:
except Exception as e: except Exception as e:
self.common.log( self.common.log(
"ReceiveModeWeb", "ReceiveModeWeb",
"send_websocket_notification", "send_webhook_notification",
f"sending failed: {e}", f"sending failed: {e}",
) )