feat(exercises): update to version 0.8.64 and enhance inline media functionality
Deploy Development / deploy (push) Successful in 35s
Test Suite / pytest-backend (push) Successful in 25s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 6s
Test Suite / playwright-tests (push) Successful in 23s
Test Suite / pytest-backend (pull_request) Successful in 23s
Test Suite / lint-backend (pull_request) Successful in 0s
Test Suite / build-frontend (pull_request) Successful in 14s
Test Suite / playwright-tests (pull_request) Successful in 22s
Deploy Development / deploy (push) Successful in 35s
Test Suite / pytest-backend (push) Successful in 25s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 6s
Test Suite / playwright-tests (push) Successful in 23s
Test Suite / pytest-backend (pull_request) Successful in 23s
Test Suite / lint-backend (pull_request) Successful in 0s
Test Suite / build-frontend (pull_request) Successful in 14s
Test Suite / playwright-tests (pull_request) Successful in 22s
- Incremented application version to 0.8.64 and updated changelog with new features. - Implemented inline media support in Rich Text Editor, allowing for drag-and-drop functionality and auto-scrolling. - Enhanced media handling with a modal picker for media insertion, size selection, and improved user experience. - Updated documentation to reflect changes in media handling and inline media specifications. - Adjusted various API specifications to support new inline media features.
This commit is contained in:
1 parent
5cf775c920
commit
bab9b178a4
7 files changed
+102
-60
No files matched your search
+56
-25
@@ -19,6 +19,26 @@ from club_tenancy import (
|
||||
router = APIRouter(prefix="/api", tags=["clubs"])
|
||||
|
||||
|
||||
def _blank_to_none(value: Any) -> Any:
|
||||
"""Frontend sendet häufig '' für optionale Felder — ungültig für PostgreSQL TIME/INTEGER."""
|
||||
if value is None:
|
||||
return None
|
||||
if isinstance(value, str) and value.strip() == "":
|
||||
return None
|
||||
return value
|
||||
|
||||
|
||||
def _optional_int(value: Any) -> Optional[int]:
|
||||
v = _blank_to_none(value)
|
||||
if v is None:
|
||||
return None
|
||||
try:
|
||||
i = int(v)
|
||||
except (TypeError, ValueError):
|
||||
return None
|
||||
return i if i > 0 else None
|
||||
|
||||
|
||||
# ── List Clubs ────────────────────────────────────────────────────────
|
||||
@router.get("/clubs")
|
||||
def list_clubs(
|
||||
@@ -581,9 +601,16 @@ def create_training_group(data: dict, tenant: TenantContext = Depends(get_tenant
|
||||
if not club_id or not name:
|
||||
raise HTTPException(400, "club_id und name sind Pflichtfelder")
|
||||
|
||||
trainer_id = data.get("trainer_id")
|
||||
if trainer_id in (None, "", 0) and role in ("trainer", "user"):
|
||||
trainer_id = profile_id
|
||||
raw_tid = data.get("trainer_id")
|
||||
if role in ("trainer", "user"):
|
||||
parsed_tid = _optional_int(raw_tid)
|
||||
trainer_id = parsed_tid if parsed_tid is not None else profile_id
|
||||
else:
|
||||
trainer_id = _optional_int(raw_tid)
|
||||
|
||||
division_id = _optional_int(data.get("division_id"))
|
||||
co_raw = data.get("co_trainer_ids")
|
||||
co_trainer_ids = [] if co_raw is None else co_raw
|
||||
|
||||
with get_db() as conn:
|
||||
cur = get_cursor(conn)
|
||||
@@ -610,19 +637,19 @@ def create_training_group(data: dict, tenant: TenantContext = Depends(get_tenant
|
||||
) RETURNING id
|
||||
""",
|
||||
(
|
||||
club_id,
|
||||
data.get("division_id"),
|
||||
int(club_id),
|
||||
division_id,
|
||||
name,
|
||||
data.get("focus"),
|
||||
data.get("level"),
|
||||
data.get("age_group"),
|
||||
data.get("weekday"),
|
||||
data.get("time_start"),
|
||||
data.get("time_end"),
|
||||
data.get("location"),
|
||||
_blank_to_none(data.get("focus")),
|
||||
_blank_to_none(data.get("level")),
|
||||
_blank_to_none(data.get("age_group")),
|
||||
_blank_to_none(data.get("weekday")),
|
||||
_blank_to_none(data.get("time_start")),
|
||||
_blank_to_none(data.get("time_end")),
|
||||
_blank_to_none(data.get("location")),
|
||||
trainer_id,
|
||||
data.get("co_trainer_ids"),
|
||||
data.get("status", "active"),
|
||||
co_trainer_ids,
|
||||
data.get("status") or "active",
|
||||
),
|
||||
)
|
||||
|
||||
@@ -662,6 +689,10 @@ def update_training_group(group_id: int, data: dict, tenant: TenantContext = Dep
|
||||
if not allowed:
|
||||
raise HTTPException(403, "Keine Berechtigung")
|
||||
|
||||
co_upd = data.get("co_trainer_ids")
|
||||
if co_upd is None:
|
||||
co_upd = []
|
||||
|
||||
cur.execute(
|
||||
"""
|
||||
UPDATE training_groups SET
|
||||
@@ -682,17 +713,17 @@ def update_training_group(group_id: int, data: dict, tenant: TenantContext = Dep
|
||||
""",
|
||||
(
|
||||
data.get("name"),
|
||||
data.get("division_id"),
|
||||
data.get("focus"),
|
||||
data.get("level"),
|
||||
data.get("age_group"),
|
||||
data.get("weekday"),
|
||||
data.get("time_start"),
|
||||
data.get("time_end"),
|
||||
data.get("location"),
|
||||
data.get("trainer_id"),
|
||||
data.get("co_trainer_ids"),
|
||||
data.get("status"),
|
||||
_optional_int(data.get("division_id")),
|
||||
_blank_to_none(data.get("focus")),
|
||||
_blank_to_none(data.get("level")),
|
||||
_blank_to_none(data.get("age_group")),
|
||||
_blank_to_none(data.get("weekday")),
|
||||
_blank_to_none(data.get("time_start")),
|
||||
_blank_to_none(data.get("time_end")),
|
||||
_blank_to_none(data.get("location")),
|
||||
_optional_int(data.get("trainer_id")),
|
||||
co_upd,
|
||||
data.get("status") or "active",
|
||||
group_id,
|
||||
),
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user