Compare commits

...

3 Commits

Author SHA1 Message Date
shamoon
df5af5c8ad Fix: correctly handle dict data with webhook (#9674) 2025-04-16 00:07:08 -07:00
shamoon
67a97ffc4d Documentation: expound email config explanation 2025-04-15 07:52:53 -07:00
github-actions[bot]
45b39f36d6 Documentation: Add v2.15.2 changelog (#9660) 2025-04-14 14:08:18 -07:00
4 changed files with 61 additions and 14 deletions

View File

@@ -1,5 +1,28 @@
# Changelog
## paperless-ngx 2.15.2
### Bug Fixes
- Fix: Adds better handling during folder checking/creation/permissions for non-root [@stumpylog](https://github.com/stumpylog) ([#9616](https://github.com/paperless-ngx/paperless-ngx/pull/9616))
- Fix: Explicitly set the HOME environment to resolve issues running as root with database certificates [@stumpylog](https://github.com/stumpylog) ([#9643](https://github.com/paperless-ngx/paperless-ngx/pull/9643))
- Fix: prevent self-linking when bulk edit doc link [@shamoon](https://github.com/shamoon) ([#9629](https://github.com/paperless-ngx/paperless-ngx/pull/9629))
### Dependencies
- Chore: Bump celery to 5.5.1 [@hannesortmeier](https://github.com/hannesortmeier) ([#9642](https://github.com/paperless-ngx/paperless-ngx/pull/9642))
### All App Changes
<details>
<summary>4 changes</summary>
- Tweak: consistently use created date when displaying doc in list [@shamoon](https://github.com/shamoon) ([#9651](https://github.com/paperless-ngx/paperless-ngx/pull/9651))
- Fix: Adds better handling during folder checking/creation/permissions for non-root [@stumpylog](https://github.com/stumpylog) ([#9616](https://github.com/paperless-ngx/paperless-ngx/pull/9616))
- Fix: Explicitly set the HOME environment to resolve issues running as root with database certificates [@stumpylog](https://github.com/stumpylog) ([#9643](https://github.com/paperless-ngx/paperless-ngx/pull/9643))
- Fix: prevent self-linking when bulk edit doc link [@shamoon](https://github.com/shamoon) ([#9629](https://github.com/paperless-ngx/paperless-ngx/pull/9629))
</details>
## paperless-ngx 2.15.1
### Bug Fixes

View File

@@ -1670,7 +1670,7 @@ started by the container.
## Email sending
Setting an SMTP server for the backend will allow you to reset your
Setting an SMTP server for the backend will allow you to use the Email workflow action, send documents from the UI as well as reset your
password. All of these options come from their similarly-named [Django settings](https://docs.djangoproject.com/en/4.2/ref/settings/#email-host)
#### [`PAPERLESS_EMAIL_HOST=<str>`](#PAPERLESS_EMAIL_HOST) {#PAPERLESS_EMAIL_HOST}

View File

@@ -622,20 +622,30 @@ def send_webhook(
as_json: bool = False,
):
try:
post_args = {
"url": url,
"headers": headers,
"files": files,
}
if as_json:
httpx.post(
url,
json=data,
files=files,
headers=headers,
).raise_for_status()
post_args["json"] = data
elif isinstance(data, dict):
post_args["data"] = data
else:
httpx.post(
url,
content=data,
files=files,
headers=headers,
).raise_for_status()
post_args["content"] = data
httpx.post(
**post_args,
).raise_for_status()
logger.info(
f"Webhook sent to {url}",
)
except Exception as e:
logger.error(
f"Failed attempt sending webhook to {url}: {e}",
)
raise e
logger.info(
f"Webhook sent to {url}",
)

View File

@@ -2614,7 +2614,7 @@ class TestWorkflows(
)
mock_post.assert_called_once_with(
"http://paperless-ngx.com",
url="http://paperless-ngx.com",
content="Test message",
headers={},
files=None,
@@ -2623,6 +2623,20 @@ class TestWorkflows(
expected_str = "Webhook sent to http://paperless-ngx.com"
self.assertIn(expected_str, cm.output[0])
# with dict
send_webhook(
url="http://paperless-ngx.com",
data={"message": "Test message"},
headers={},
files=None,
)
mock_post.assert_called_with(
url="http://paperless-ngx.com",
data={"message": "Test message"},
headers={},
files=None,
)
@mock.patch("httpx.post")
def test_workflow_webhook_send_webhook_retry(self, mock_http):
mock_http.return_value.raise_for_status = mock.Mock(