fix(gallery): drop include_hidden before the similar() call (#141 step 1)
The /similar route splats **filters into similar(), which doesn't take the new include_hidden kwarg → TypeError → 500 (test_gallery_similar). Drop it like post_id; similar() has its own presentation exclusion (#1274), so the gallery-browse flag doesn't apply there. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CDgx8bQS5YrGRK76v8HUnM
This commit is contained in:
@@ -137,7 +137,11 @@ async def similar():
|
||||
except (KeyError, ValueError):
|
||||
return jsonify({"error": "similar_to query param required"}), 400
|
||||
# post_id is the exclusive post-detail view — not a similarity scope.
|
||||
scope = {k: v for k, v in filters.items() if k != "post_id"}
|
||||
# include_hidden is a gallery-browse flag; similar() has its OWN presentation
|
||||
# exclusion (a similarity-quality concern, #1274), so drop it here (#141).
|
||||
scope = {
|
||||
k: v for k, v in filters.items() if k not in ("post_id", "include_hidden")
|
||||
}
|
||||
async with get_session() as session:
|
||||
svc = GalleryService(session)
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user