Move calendar management to /{slug}/admin/ and reserve slug
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m3s

- Change calendars blueprint prefix from /calendars to /admin
- Simplify routes from /calendars/ to / within blueprint
- Reserve admin, markets, payments, entries as calendar slugs
- Update blog admin nav link to /{slug}/admin/

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 16:31:24 +00:00
parent efae7f5533
commit 4fe5afe3e6
4 changed files with 9 additions and 7 deletions

View File

@@ -86,7 +86,9 @@ async def create_calendar(sess: AsyncSession, post_id: int, name: str) -> Calend
name = (name or "").strip()
if not name:
raise CalendarError("Calendar name must not be empty.")
slug=slugify(name)
slug = slugify(name)
if slug in ("admin", "markets", "payments", "entries"):
raise CalendarError(f'"{slug}" is a reserved name and cannot be used as a calendar name.')
# Ensure post exists (avoid silent FK errors in some DBs)
raw = await fetch_data("blog", "post-by-id", params={"id": post_id}, required=False)