mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-02 06:26:10 -04:00
Improve webhook label in GUI, improve webhook message that gets POSTed, and display webhook errors without verbose mode
This commit is contained in:
parent
3a0d8bc4d4
commit
2e2e775125
2 changed files with 7 additions and 7 deletions
|
@ -108,7 +108,11 @@ class ReceiveModeWeb:
|
|||
and not request.upload_error
|
||||
and len(files) > 0
|
||||
):
|
||||
self.send_webhook_notification(f"{len(files)} files uploaded")
|
||||
if len(files) == 1:
|
||||
file_msg = "1 file"
|
||||
else:
|
||||
file_msg = f"{len(files)} files"
|
||||
self.send_webhook_notification(f"{file_msg} uploaded to OnionShare")
|
||||
|
||||
if request.upload_error:
|
||||
self.common.log(
|
||||
|
@ -191,11 +195,7 @@ class ReceiveModeWeb:
|
|||
proxies=self.web.proxies,
|
||||
)
|
||||
except Exception as e:
|
||||
self.common.log(
|
||||
"ReceiveModeWeb",
|
||||
"send_webhook_notification",
|
||||
f"sending failed: {e}",
|
||||
)
|
||||
print(f"Webhook notification failed: {e}")
|
||||
|
||||
|
||||
class ReceiveModeWSGIMiddleware(object):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue