Move calendar blueprint to app level for correct URL routing

The calendar blueprint was nested under calendars (admin), making URLs
/{slug}/admin/{calendar_slug}/ instead of /{slug}/{calendar_slug}/.

Register calendar blueprint directly on the app and update all endpoint
references from calendars.calendar.* to calendar.* (37 in Python,
~50 in templates).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 16:50:13 +00:00
parent a8edc26a1d
commit 5957bd8941
40 changed files with 106 additions and 105 deletions

View File

@@ -1,4 +1,5 @@
from .all_events.routes import register as register_all_events
from .calendar.routes import register as register_calendar
from .calendars.routes import register as register_calendars
from .markets.routes import register as register_markets
from .payments.routes import register as register_payments

View File

@@ -12,8 +12,6 @@ from .services.calendars import (
create_calendar as svc_create_calendar,
)
from ..calendar.routes import register as register_calendar
from shared.browser.app.redis_cacher import cache_page, clear_cache
from shared.browser.app.authz import require_admin
@@ -22,9 +20,6 @@ from shared.browser.app.utils.htmx import is_htmx_request
def register():
bp = Blueprint("calendars", __name__, url_prefix='/admin')
bp.register_blueprint(
register_calendar(),
)
@bp.context_processor
async def inject_root():
# Must always return a dict