feat(p06): Copyright-Feld und Einwilligungskontext in Rechte-Erklaerung
Deploy Development / deploy (push) Successful in 40s
Test Suite / pytest-backend (push) Successful in 33s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 10s
Test Suite / playwright-tests (push) Failing after 1m2s
Deploy Development / deploy (push) Successful in 40s
Test Suite / pytest-backend (push) Successful in 33s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 10s
Test Suite / playwright-tests (push) Failing after 1m2s
Migration 049: 4 optionale TEXT-Spalten in media_asset_rights_declarations (person_consent_context, parental_consent_context, music_rights_context, third_party_rights_context) fuer Freitext zum Einwilligungskontext. Backend: - media_rights.py: write_rights_declaration speichert 4 Kontextfelder - media_assets.py: copyright_notice + 4 Kontextfelder in Bulk-Upload, RightsDeclarationBody, MediaAssetPatch, MediaBulkPatchBody - exercises.py: copyright_notice + 4 Kontextfelder in upload_exercise_media, wird in INSERT gespeichert Frontend (alle 3 Formulare): - RightsDeclarationDialog: Copyright-Eingabefeld (immer sichtbar) + Freitext-Textarea bei jeder Ja-Antwort (Personen, Minderjaehrige, Musik, Fremdinhalte) - ExerciseInlineFileMediaModal: gleiche Felder inline im Upload-Tab - ExerciseInlineEmbedModal: gleiche Felder inline - api.js: copyright_notice + 4 Kontextfelder in bulkUploadMediaAssets version: 0.8.77 module: media_rights 1.1.0, media_assets 1.14.0, exercises 2.21.0 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
42aec79ad1
commit
4bc24b4caf
10 files changed
+313
-193
No files matched your search
@@ -2527,16 +2527,21 @@ async def upload_exercise_media(
|
||||
description: str = Form(""),
|
||||
context: str = Form("ablauf"),
|
||||
is_primary: bool = Form(False),
|
||||
copyright_notice: Optional[str] = Form(None),
|
||||
# P-06: Rechte-Erklaerung (Pflicht bei Datei-Upload mit neuem media_asset)
|
||||
rights_holder_confirmed: Optional[bool] = Form(None),
|
||||
contains_identifiable_persons: Optional[bool] = Form(None),
|
||||
person_consent_confirmed: Optional[bool] = Form(None),
|
||||
person_consent_context: Optional[str] = Form(None),
|
||||
contains_minors: Optional[bool] = Form(None),
|
||||
parental_consent_confirmed: Optional[bool] = Form(None),
|
||||
parental_consent_context: Optional[str] = Form(None),
|
||||
contains_music: Optional[bool] = Form(None),
|
||||
music_rights_confirmed: Optional[bool] = Form(None),
|
||||
music_rights_context: Optional[str] = Form(None),
|
||||
contains_third_party_content: Optional[bool] = Form(None),
|
||||
third_party_rights_confirmed: Optional[bool] = Form(None),
|
||||
third_party_rights_context: Optional[str] = Form(None),
|
||||
):
|
||||
profile_id = tenant.profile_id
|
||||
if media_type not in ("image", "video", "document", "sketch"):
|
||||
@@ -2775,11 +2780,12 @@ async def upload_exercise_media(
|
||||
if not dest_path.is_file():
|
||||
dest_path.write_bytes(raw)
|
||||
|
||||
clean_cr = (copyright_notice or "").strip() or None
|
||||
cur.execute(
|
||||
"""INSERT INTO media_assets (
|
||||
mime_type, byte_size, sha256, original_filename, visibility, club_id,
|
||||
uploaded_by_profile_id, copyright_notice, storage_backend, storage_key, lifecycle_state
|
||||
) VALUES (%s, %s, %s, %s, %s, %s, %s, NULL, 'local', %s, 'active')
|
||||
) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, 'local', %s, 'active')
|
||||
RETURNING id""",
|
||||
(
|
||||
mime,
|
||||
@@ -2789,6 +2795,7 @@ async def upload_exercise_media(
|
||||
ex_vis,
|
||||
dedupe_club,
|
||||
profile_id,
|
||||
clean_cr,
|
||||
storage_key,
|
||||
),
|
||||
)
|
||||
@@ -2799,12 +2806,16 @@ async def upload_exercise_media(
|
||||
"rights_holder_confirmed": rights_holder_confirmed,
|
||||
"contains_identifiable_persons": contains_identifiable_persons,
|
||||
"person_consent_confirmed": person_consent_confirmed,
|
||||
"person_consent_context": person_consent_context,
|
||||
"contains_minors": contains_minors,
|
||||
"parental_consent_confirmed": parental_consent_confirmed,
|
||||
"parental_consent_context": parental_consent_context,
|
||||
"contains_music": contains_music,
|
||||
"music_rights_confirmed": music_rights_confirmed,
|
||||
"music_rights_context": music_rights_context,
|
||||
"contains_third_party_content": contains_third_party_content,
|
||||
"third_party_rights_confirmed": third_party_rights_confirmed,
|
||||
"third_party_rights_context": third_party_rights_context,
|
||||
}
|
||||
validate_rights_declaration(p06_decl, ex_vis)
|
||||
write_rights_declaration(cur, aid, profile_id, "upload", ex_vis, p06_decl)
|
||||
|
||||
Reference in new issue
Block a user