mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-25 15:29:42 -05:00
Oops, webhook not websocket
This commit is contained in:
parent
29970d38ff
commit
84958ef7f3
@ -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}",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user