Compare commits

...
2 Commits
Author SHA1 Message Date
Phil c9b882aa46 Merge branch 'feat/v2.17.0-article-urls' for v2.17.1 release
Build Container / build (push) Successful in 9m8s
2026-11-12 12:53:59 -07:00
PhilandClaude Opus 5.5 6368365bd6 fix: build post URLs without a request context (v2.17.1)
Crossposting runs in a background worker; url_for there raised and every
crosspost failed. post_url now joins SITE_URL and post_path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 12:53:54 -07:00
4 changed files with 23 additions and 4 deletions

No files matched your search

+6
View File
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [2.17.1] - 2026-11-12
### Fixed
- Crossposting failed in 2.17.0 (never deployed): post URLs were built with Flask's `url_for`, which needs a web request, and crossposts run in a background worker. URLs are now built from `SITE_URL`
## [2.17.0] - 2026-11-12
Articles get URLs of their own (ADR-077).
@@ -21,3 +21,9 @@ slugs for notes, redirects both ways, updates via the old URL, slug rules
(accents, duplicates, reserved, `mp-slug`, emoji, long titles), 201 on
adding/removing a title, 410 for a deleted article, webmention targets and
homepage links, search result URLs.
## v2.17.1
`post_url` first used `url_for`, which fails outside a request (the
crosspost and backfeed workers); CI caught it in `test_likes_reposts.py`
before 2.17.0 was built. It now joins `SITE_URL` and `post_path`.
+2 -2
View File
@@ -468,5 +468,5 @@ def create_app(config=None):
# Package version (Semantic Versioning 2.0.0)
# See docs/standards/versioning-strategy.md for details
__version__ = "2.17.0"
__version_info__ = (2, 17, 0)
__version__ = "2.17.1"
__version_info__ = (2, 17, 1)
+9 -2
View File
@@ -722,8 +722,15 @@ def post_path(slug: str, title: Optional[str] = None) -> str:
def post_url(slug: str, title: Optional[str] = None) -> str:
"""A post's absolute URL (see post_path)"""
return absolute_url_for("public.article" if title else "public.note", slug=slug)
"""
A post's absolute URL (see post_path)
Built from SITE_URL without url_for, so it works outside a request:
crossposting and backfeed run in background workers (v2.17.0).
"""
from flask import current_app
return current_app.config["SITE_URL"].rstrip("/") + post_path(slug, title)
def iso_utc(value) -> str: