diff options
author | Micah Lee <micah@micahflee.com> | 2021-04-12 09:08:47 -0700 |
---|---|---|
committer | Micah Lee <micah@micahflee.com> | 2021-04-12 09:08:47 -0700 |
commit | 839b23f87a367a60f25f4f2979611547e6590b90 (patch) | |
tree | 72436f82a1b8414d34ccbbb169476d11e63e1463 /cli | |
parent | eb628ad0935df410f760a5b2558ea84d78339b96 (diff) | |
download | onionshare-839b23f87a367a60f25f4f2979611547e6590b90.tar.gz onionshare-839b23f87a367a60f25f4f2979611547e6590b90.zip |
Improve webhook label in GUI, improve webhook message that gets POSTed, and display webhook errors without verbose mode
Diffstat (limited to 'cli')
-rw-r--r-- | cli/onionshare_cli/web/receive_mode.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cli/onionshare_cli/web/receive_mode.py b/cli/onionshare_cli/web/receive_mode.py index 26ec0b65..46f471a8 100644 --- a/cli/onionshare_cli/web/receive_mode.py +++ b/cli/onionshare_cli/web/receive_mode.py @@ -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): |