fixed mandate bootstrap

This commit is contained in:
patrick-motsch 2026-02-10 00:35:29 +01:00
parent 18cdbe4c5c
commit 82badd9e4d
4 changed files with 4 additions and 4 deletions

View file

@ -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}

View file

@ -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}")

View file

@ -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

View file

@ -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