Files
stiftung-management-system/app/stiftung/migrations/0062_veranstaltungseinladung_vorlage.py
SysAdmin Agent aed540fe4b
Some checks failed
CI/CD Pipeline / test (push) Has been cancelled
CI/CD Pipeline / deploy (push) Has been cancelled
Code Quality / quality (push) Has been cancelled
Add Vorlagen editor, upload portal, onboarding, and participant import command
- Dokument-Vorlagen-Editor: create/edit/reset document templates (admin)
- Upload-Portal: public portal for Nachweis uploads via token
- Onboarding: invite Destinatäre via email with multi-step wizard
- Bestätigungsschreiben: preview and send confirmation letters
- Email settings: SMTP configuration UI
- Management command: import_veranstaltung_teilnehmer for bulk participant import

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 09:25:18 +00:00

58 lines
2.3 KiB
Python

"""Seed Veranstaltungseinladung (Serienbrief) into DokumentVorlage."""
import os
from django.conf import settings
from django.db import migrations
def seed_veranstaltungseinladung(apps, schema_editor):
DokumentVorlage = apps.get_model("stiftung", "DokumentVorlage")
schluessel = "stiftung/veranstaltung/serienbrief_pdf.html"
template_path = os.path.join(settings.BASE_DIR, "templates", schluessel)
if os.path.exists(template_path):
with open(template_path, "r", encoding="utf-8") as f:
html_inhalt = f.read()
DokumentVorlage.objects.get_or_create(
schluessel=schluessel,
defaults={
"bezeichnung": "Veranstaltungseinladung (Serienbrief)",
"kategorie": "serienbrief",
"html_inhalt": html_inhalt,
"verfuegbare_variablen": {
"veranstaltung.titel": "Titel der Veranstaltung",
"veranstaltung.datum": "Datum der Veranstaltung",
"veranstaltung.uhrzeit": "Uhrzeit",
"veranstaltung.ort": "Ort / Gasthaus",
"veranstaltung.adresse": "Adresse des Veranstaltungsorts",
"veranstaltung.betreff": "Betreffzeile (optional)",
"veranstaltung.briefvorlage": "Freier Brieftext (HTML, optional)",
"veranstaltung.unterschrift_1_name": "Name Unterschrift 1",
"veranstaltung.unterschrift_1_titel": "Titel Unterschrift 1",
"veranstaltung.unterschrift_2_name": "Name Unterschrift 2",
"veranstaltung.unterschrift_2_titel": "Titel Unterschrift 2",
"teilnehmer": "Liste der Teilnehmer (for-Schleife)",
"t.anrede": "Anrede des Teilnehmers (in Schleife)",
"t.vorname": "Vorname des Teilnehmers",
"t.nachname": "Nachname des Teilnehmers",
"t.strasse": "Straße des Teilnehmers",
"t.plz": "PLZ des Teilnehmers",
"t.ort": "Ort des Teilnehmers",
},
},
)
class Migration(migrations.Migration):
dependencies = [
("stiftung", "0061_dokument_vorlage"),
]
operations = [
migrations.RunPython(seed_veranstaltungseinladung, migrations.RunPython.noop),
]