From 82badd9e4d6aa6e165b3d1bde0e0d10d495bff50 Mon Sep 17 00:00:00 2001 From: patrick-motsch Date: Tue, 10 Feb 2026 00:35:29 +0100 Subject: [PATCH] fixed mandate bootstrap --- modules/datamodels/datamodelInvitation.py | 2 +- modules/interfaces/interfaceBootstrap.py | 2 +- modules/routes/routeNotifications.py | 2 +- modules/routes/routeSecurityLocal.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/datamodels/datamodelInvitation.py b/modules/datamodels/datamodelInvitation.py index ef6d6a80..348ef532 100644 --- a/modules/datamodels/datamodelInvitation.py +++ b/modules/datamodels/datamodelInvitation.py @@ -87,7 +87,7 @@ class Invitation(BaseModel): ) # Email-Status - emailSent: bool = Field( + emailSent: Optional[bool] = Field( default=False, description="Whether the invitation email was successfully sent", json_schema_extra={"frontend_type": "checkbox", "frontend_readonly": True, "frontend_required": False} diff --git a/modules/interfaces/interfaceBootstrap.py b/modules/interfaces/interfaceBootstrap.py index 3f678a2b..2b55af51 100644 --- a/modules/interfaces/interfaceBootstrap.py +++ b/modules/interfaces/interfaceBootstrap.py @@ -272,7 +272,7 @@ def initRootMandate(db: DatabaseConnector) -> Optional[str]: return mandateId logger.info("Creating Root mandate") - rootMandate = Mandate(name="root", isSystem=True, enabled=True) + rootMandate = Mandate(name="root", label="Root", isSystem=True, enabled=True) createdMandate = db.recordCreate(Mandate, rootMandate) mandateId = createdMandate.get("id") logger.info(f"Root mandate created with ID {mandateId}") diff --git a/modules/routes/routeNotifications.py b/modules/routes/routeNotifications.py index 00e9bbcd..fc2e2608 100644 --- a/modules/routes/routeNotifications.py +++ b/modules/routes/routeNotifications.py @@ -442,7 +442,7 @@ def _handleInvitationAction( # Get mandate name for result message mandate = rootInterface.getMandate(mandateId) if mandateId else None - mandateName = mandate.mandateLabel if mandate and mandate.mandateLabel else mandateId + mandateName = (mandate.label or mandate.name) if mandate else mandateId # Check if user already has this mandate existingMembership = rootInterface.getUserMandate(str(currentUser.id), mandateId) if mandateId else None diff --git a/modules/routes/routeSecurityLocal.py b/modules/routes/routeSecurityLocal.py index 46d00152..34bffb64 100644 --- a/modules/routes/routeSecurityLocal.py +++ b/modules/routes/routeSecurityLocal.py @@ -344,7 +344,7 @@ Falls Sie sich nicht registriert haben, können Sie diese E-Mail ignorieren.""" # Get mandate name for notification using interface method mandateId = invitation.mandateId mandate = appInterface.getMandate(mandateId) - mandateName = mandate.mandateLabel if mandate else "PowerOn" + mandateName = (mandate.label or mandate.name) if mandate else "PowerOn" # Get inviter name inviterId = invitation.createdBy