Update Version and Enhance Club Creation Request Management
Deploy Development / deploy (push) Successful in 42s
Test Suite / pytest-backend (push) Successful in 39s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m20s

- Incremented application version to 0.8.192 and database schema version to 20260606081.
- Updated club module versions for 'clubs' and 'club_creation_requests' to reflect recent changes.
- Implemented logic to mark approved club creation requests as 'superseded' when the associated club is deleted.
- Refactored frontend components to clear session storage for coach-related keys upon logout and during login checks.
- Enhanced onboarding page to accurately display the status of club creation requests based on their validity.
This commit is contained in:
Lars committed 2026-06-07 07:31:05 +02:00
1 parent 37785135b1
commit fa10450315
9 files changed
+71 -13

No files matched your search

@@ -0,0 +1,13 @@
-- Migration 081: Status superseded wenn freigegebener Verein gelöscht wurde
ALTER TABLE club_creation_requests
DROP CONSTRAINT IF EXISTS club_creation_requests_status_check;
ALTER TABLE club_creation_requests
ADD CONSTRAINT club_creation_requests_status_check
CHECK (status IN ('pending', 'approved', 'rejected', 'withdrawn', 'superseded'));
-- Bestehende Drift: approved ohne Verein (ON DELETE SET NULL auf created_club_id)
UPDATE club_creation_requests
SET status = 'superseded', updated_at = NOW()
WHERE status = 'approved' AND created_club_id IS NULL;
+10 -2
View File
@@ -112,6 +112,14 @@ class CreationRequestCreate(BaseModel):
message: Optional[str] = Field(None, max_length=2000)
def _normalize_creation_request_row(row: Dict[str, Any]) -> Dict[str, Any]:
"""Approved ohne Verein → superseded (z. B. nach Vereinslöschung, FK SET NULL)."""
d = dict(row)
if d.get("status") == "approved" and not d.get("created_club_id"):
d["status"] = "superseded"
return d
def _response_one(cur, req_id: int, viewer_profile_id: int) -> Dict[str, Any]:
cur.execute(
"""
@@ -125,7 +133,7 @@ def _response_one(cur, req_id: int, viewer_profile_id: int) -> Dict[str, Any]:
row = cur.fetchone()
if not row:
raise HTTPException(status_code=404, detail="Antrag nicht gefunden")
return r2d(row)
return _normalize_creation_request_row(r2d(row))
def _assert_platform_admin(tenant: TenantContext) -> None:
@@ -157,7 +165,7 @@ def get_my_creation_requests(tenant: TenantContext = Depends(get_tenant_context)
""",
(pid,),
)
return [r2d(r) for r in cur.fetchall()]
return [_normalize_creation_request_row(r2d(r)) for r in cur.fetchall()]
@router.post("/me/club-creation-requests", status_code=201)
+10
View File
@@ -336,6 +336,16 @@ def delete_club(club_id: int, tenant: TenantContext = Depends(get_tenant_context
if not cur.fetchone():
raise HTTPException(404, "Verein nicht gefunden")
# Gründungsanträge: Freigabe verliert Gültigkeit wenn Verein entfernt wird
cur.execute(
"""
UPDATE club_creation_requests
SET status = 'superseded', updated_at = NOW()
WHERE created_club_id = %s AND status = 'approved'
""",
(club_id,),
)
# Delete (CASCADE handles divisions and groups)
cur.execute("DELETE FROM clubs WHERE id = %s", (club_id,))
conn.commit()
+4 -4
View File
@@ -1,8 +1,8 @@
# Shinkan Jinkendo Version Information
APP_VERSION = "0.8.191"
APP_VERSION = "0.8.192"
BUILD_DATE = "2026-06-06"
DB_SCHEMA_VERSION = "20260606080"
DB_SCHEMA_VERSION = "20260606081"
MODULE_VERSIONS = {
"legal_documents": "1.4.0", # Admin: Live-Vorschau pro Abschnitt + modale Vollvorschau (Editor + Dokumentenliste)
@@ -11,10 +11,10 @@ MODULE_VERSIONS = {
"tenant_context": "1.1.0", # M3: account_state + email_verified im TenantContext
"capabilities": "1.0.1", # resolve_capabilities_map für /me/entitlements
"account_lifecycle": "1.1.0", # Phase A: account_onboarding_gate API-Middleware
"clubs": "0.4.1", # Alle geschützten Endpoints Depends(get_tenant_context); profile_id/role aus TenantContext
"clubs": "0.4.2", # delete_club: Gründungsanträge → superseded
"club_memberships": "1.0.1", # Depends(get_tenant_context)
"club_join_requests": "1.0.1", # Depends(get_tenant_context)
"club_creation_requests": "1.0.0", # M7: Gründungsanträge + Admin-Freigabe
"club_creation_requests": "1.0.1", # superseded wenn freigegebener Verein gelöscht
"admin_users": "1.0.0", # GET /api/admin/users
"club_features": "1.2.0", # M4: club_features_map für /me/entitlements
"entitlements": "1.0.0", # GET /api/me/entitlements — capabilities + features