refactor: extract star/notification/badge helpers into database.py and add enrich_items content module

Introduce `update_target_stars`, `get_target_owner_uid`, and `VOTABLE_TARGETS`/`STAR_TARGETS` in database.py; replace inline badge insertion with `award_badge()` and inline notification creation with `create_notification()` across auth, comments, and follow routers; add `enrich_items()` in new content module to centralize post/gist list assembly and remove duplicated enrichment logic from feed and gists routers.
This commit is contained in:
2026-05-23 06:34:13 +00:00
parent ab1121a42a
commit d7d8314da0
34 changed files with 211 additions and 367 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ def test_uploaded_file_served_as_attachment(app_server):
def test_upload_requires_login(app_server):
r = requests.post(f"{BASE_URL}/uploads/upload", files={"file": ("x.png", _png_bytes(), "image/png")}, allow_redirects=False)
assert r.status_code in (302, 303)
assert r.status_code == 401
def test_delete_own_allowed_other_user_forbidden(app_server):