Rename coop to blog in app code and config
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m13s

- App name: "coop" → "blog"
- coop_context() → blog_context()
- coop_url → blog_url imports
- app_url("coop") → app_url("blog")
- Config keys: coop_root/coop_title → market_root/market_title
- Sync shared submodule

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-23 08:33:07 +00:00
parent 065147569c
commit 82968a366f
7 changed files with 19 additions and 19 deletions

8
app.py
View File

@@ -19,9 +19,9 @@ from bp import (
)
async def coop_context() -> dict:
async def blog_context() -> dict:
"""
Coop app context processor.
Blog app context processor.
- menu_items: via shared.services.navigation
- cart_count/cart_total: via cart service (shared DB)
@@ -50,8 +50,8 @@ def create_app() -> "Quart":
from services import register_domain_services
app = create_base_app(
"coop",
context_fn=coop_context,
"blog",
context_fn=blog_context,
domain_services_fn=register_domain_services,
)

View File

@@ -26,7 +26,7 @@ from shared.models import User, MagicLink, UserNewsletter
from shared.models.ghost_membership_entities import GhostNewsletter
from shared.config import config
from shared.utils import host_url
from shared.infrastructure.urls import coop_url
from shared.infrastructure.urls import blog_url
from shared.services.widget_registry import widgets
from sqlalchemy.orm import selectinload
@@ -83,7 +83,7 @@ def register(url_prefix="/auth"):
if cross_cart_sid:
qsession["cart_sid"] = cross_cart_sid
if g.get("user"):
return redirect(coop_url("/"))
return redirect(blog_url("/"))
return await render_template("_types/auth/login.html")
@@ -346,6 +346,6 @@ def register(url_prefix="/auth"):
@auth_bp.post("/logout/")
async def logout():
qsession.pop(SESSION_USER_KEY, None)
return redirect(coop_url("/"))
return redirect(blog_url("/"))
return auth_bp

View File

@@ -1,7 +1,7 @@
from urllib.parse import urlparse
from quart import session
from shared.infrastructure.urls import coop_url
from shared.infrastructure.urls import blog_url
LOGIN_REDIRECT_SESSION_KEY = "login_redirect_to"
@@ -32,7 +32,7 @@ def store_login_redirect_target() -> None:
def pop_login_redirect_target() -> str:
path = session.pop(LOGIN_REDIRECT_SESSION_KEY, None)
if not path or not isinstance(path, str):
return coop_url("/auth/")
return blog_url("/auth/")
# Absolute URL: return as-is (cross-app redirect)
if path.startswith("http://") or path.startswith("https://"):
@@ -40,6 +40,6 @@ def pop_login_redirect_target() -> str:
# Relative path: must start with / and not //
if path.startswith("/") and not path.startswith("//"):
return coop_url(path)
return blog_url(path)
return coop_url("/auth/")
return blog_url("/auth/")

View File

@@ -1100,7 +1100,7 @@ async def sync_single_post(sess: AsyncSession, ghost_id: str) -> None:
if not post.is_page and post.user_id:
from shared.services.federation_publish import try_publish
from shared.infrastructure.urls import app_url
post_url = app_url("coop", f"/{post.slug}/")
post_url = app_url("blog", f"/{post.slug}/")
post_tags = [tag_map[t["id"]] for t in (gp.get("tags") or []) if t["id"] in tag_map]
if post.status == "published":
@@ -1165,7 +1165,7 @@ async def sync_single_page(sess: AsyncSession, ghost_id: str) -> None:
if post.user_id:
from shared.services.federation_publish import try_publish
from shared.infrastructure.urls import app_url
post_url = app_url("coop", f"/{post.slug}/")
post_url = app_url("blog", f"/{post.slug}/")
post_tags = [tag_map[t["id"]] for t in (gp.get("tags") or []) if t["id"] in tag_map]
if post.status == "published":

View File

@@ -3,13 +3,13 @@ base_host: "wholesale.suma.coop"
base_login: https://wholesale.suma.coop/customer/account/login/
base_url: https://wholesale.suma.coop/
title: Rose Ash
coop_root: /market
coop_title: Market
market_root: /market
market_title: Market
blog_root: /
blog_title: all the news
cart_root: /cart
app_urls:
coop: "http://localhost:8000"
blog: "http://localhost:8000"
market: "http://localhost:8001"
cart: "http://localhost:8002"
events: "http://localhost:8003"

View File

@@ -1,9 +1,9 @@
"""Blog (coop) app service registration."""
"""Blog app service registration."""
from __future__ import annotations
def register_domain_services() -> None:
"""Register services for the blog (coop) app.
"""Register services for the blog app.
Blog owns: Post, Tag, Author, PostAuthor, PostTag, PostLike.
Standard deployment registers all 4 services as real DB impls

2
shared

Submodule shared updated: b16ba34b40...798087de9a