Rename coop to blog in app code and config
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m13s
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:
8
app.py
8
app.py
@@ -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
|
- menu_items: via shared.services.navigation
|
||||||
- cart_count/cart_total: via cart service (shared DB)
|
- cart_count/cart_total: via cart service (shared DB)
|
||||||
@@ -50,8 +50,8 @@ def create_app() -> "Quart":
|
|||||||
from services import register_domain_services
|
from services import register_domain_services
|
||||||
|
|
||||||
app = create_base_app(
|
app = create_base_app(
|
||||||
"coop",
|
"blog",
|
||||||
context_fn=coop_context,
|
context_fn=blog_context,
|
||||||
domain_services_fn=register_domain_services,
|
domain_services_fn=register_domain_services,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ from shared.models import User, MagicLink, UserNewsletter
|
|||||||
from shared.models.ghost_membership_entities import GhostNewsletter
|
from shared.models.ghost_membership_entities import GhostNewsletter
|
||||||
from shared.config import config
|
from shared.config import config
|
||||||
from shared.utils import host_url
|
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 shared.services.widget_registry import widgets
|
||||||
|
|
||||||
from sqlalchemy.orm import selectinload
|
from sqlalchemy.orm import selectinload
|
||||||
@@ -83,7 +83,7 @@ def register(url_prefix="/auth"):
|
|||||||
if cross_cart_sid:
|
if cross_cart_sid:
|
||||||
qsession["cart_sid"] = cross_cart_sid
|
qsession["cart_sid"] = cross_cart_sid
|
||||||
if g.get("user"):
|
if g.get("user"):
|
||||||
return redirect(coop_url("/"))
|
return redirect(blog_url("/"))
|
||||||
return await render_template("_types/auth/login.html")
|
return await render_template("_types/auth/login.html")
|
||||||
|
|
||||||
|
|
||||||
@@ -346,6 +346,6 @@ def register(url_prefix="/auth"):
|
|||||||
@auth_bp.post("/logout/")
|
@auth_bp.post("/logout/")
|
||||||
async def logout():
|
async def logout():
|
||||||
qsession.pop(SESSION_USER_KEY, None)
|
qsession.pop(SESSION_USER_KEY, None)
|
||||||
return redirect(coop_url("/"))
|
return redirect(blog_url("/"))
|
||||||
|
|
||||||
return auth_bp
|
return auth_bp
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from quart import session
|
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"
|
LOGIN_REDIRECT_SESSION_KEY = "login_redirect_to"
|
||||||
@@ -32,7 +32,7 @@ def store_login_redirect_target() -> None:
|
|||||||
def pop_login_redirect_target() -> str:
|
def pop_login_redirect_target() -> str:
|
||||||
path = session.pop(LOGIN_REDIRECT_SESSION_KEY, None)
|
path = session.pop(LOGIN_REDIRECT_SESSION_KEY, None)
|
||||||
if not path or not isinstance(path, str):
|
if not path or not isinstance(path, str):
|
||||||
return coop_url("/auth/")
|
return blog_url("/auth/")
|
||||||
|
|
||||||
# Absolute URL: return as-is (cross-app redirect)
|
# Absolute URL: return as-is (cross-app redirect)
|
||||||
if path.startswith("http://") or path.startswith("https://"):
|
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 //
|
# Relative path: must start with / and not //
|
||||||
if path.startswith("/") and not path.startswith("//"):
|
if path.startswith("/") and not path.startswith("//"):
|
||||||
return coop_url(path)
|
return blog_url(path)
|
||||||
|
|
||||||
return coop_url("/auth/")
|
return blog_url("/auth/")
|
||||||
|
|||||||
@@ -1100,7 +1100,7 @@ async def sync_single_post(sess: AsyncSession, ghost_id: str) -> None:
|
|||||||
if not post.is_page and post.user_id:
|
if not post.is_page and post.user_id:
|
||||||
from shared.services.federation_publish import try_publish
|
from shared.services.federation_publish import try_publish
|
||||||
from shared.infrastructure.urls import app_url
|
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]
|
post_tags = [tag_map[t["id"]] for t in (gp.get("tags") or []) if t["id"] in tag_map]
|
||||||
|
|
||||||
if post.status == "published":
|
if post.status == "published":
|
||||||
@@ -1165,7 +1165,7 @@ async def sync_single_page(sess: AsyncSession, ghost_id: str) -> None:
|
|||||||
if post.user_id:
|
if post.user_id:
|
||||||
from shared.services.federation_publish import try_publish
|
from shared.services.federation_publish import try_publish
|
||||||
from shared.infrastructure.urls import app_url
|
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]
|
post_tags = [tag_map[t["id"]] for t in (gp.get("tags") or []) if t["id"] in tag_map]
|
||||||
|
|
||||||
if post.status == "published":
|
if post.status == "published":
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ base_host: "wholesale.suma.coop"
|
|||||||
base_login: https://wholesale.suma.coop/customer/account/login/
|
base_login: https://wholesale.suma.coop/customer/account/login/
|
||||||
base_url: https://wholesale.suma.coop/
|
base_url: https://wholesale.suma.coop/
|
||||||
title: Rose Ash
|
title: Rose Ash
|
||||||
coop_root: /market
|
market_root: /market
|
||||||
coop_title: Market
|
market_title: Market
|
||||||
blog_root: /
|
blog_root: /
|
||||||
blog_title: all the news
|
blog_title: all the news
|
||||||
cart_root: /cart
|
cart_root: /cart
|
||||||
app_urls:
|
app_urls:
|
||||||
coop: "http://localhost:8000"
|
blog: "http://localhost:8000"
|
||||||
market: "http://localhost:8001"
|
market: "http://localhost:8001"
|
||||||
cart: "http://localhost:8002"
|
cart: "http://localhost:8002"
|
||||||
events: "http://localhost:8003"
|
events: "http://localhost:8003"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
"""Blog (coop) app service registration."""
|
"""Blog app service registration."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
|
||||||
def register_domain_services() -> None:
|
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.
|
Blog owns: Post, Tag, Author, PostAuthor, PostTag, PostLike.
|
||||||
Standard deployment registers all 4 services as real DB impls
|
Standard deployment registers all 4 services as real DB impls
|
||||||
|
|||||||
2
shared
2
shared
Submodule shared updated: b16ba34b40...798087de9a
Reference in New Issue
Block a user