fixed mandate bootstrap
This commit is contained in:
parent
18cdbe4c5c
commit
82badd9e4d
4 changed files with 4 additions and 4 deletions
|
|
@ -87,7 +87,7 @@ class Invitation(BaseModel):
|
||||||
)
|
)
|
||||||
|
|
||||||
# Email-Status
|
# Email-Status
|
||||||
emailSent: bool = Field(
|
emailSent: Optional[bool] = Field(
|
||||||
default=False,
|
default=False,
|
||||||
description="Whether the invitation email was successfully sent",
|
description="Whether the invitation email was successfully sent",
|
||||||
json_schema_extra={"frontend_type": "checkbox", "frontend_readonly": True, "frontend_required": False}
|
json_schema_extra={"frontend_type": "checkbox", "frontend_readonly": True, "frontend_required": False}
|
||||||
|
|
|
||||||
|
|
@ -272,7 +272,7 @@ def initRootMandate(db: DatabaseConnector) -> Optional[str]:
|
||||||
return mandateId
|
return mandateId
|
||||||
|
|
||||||
logger.info("Creating Root mandate")
|
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)
|
createdMandate = db.recordCreate(Mandate, rootMandate)
|
||||||
mandateId = createdMandate.get("id")
|
mandateId = createdMandate.get("id")
|
||||||
logger.info(f"Root mandate created with ID {mandateId}")
|
logger.info(f"Root mandate created with ID {mandateId}")
|
||||||
|
|
|
||||||
|
|
@ -442,7 +442,7 @@ def _handleInvitationAction(
|
||||||
|
|
||||||
# Get mandate name for result message
|
# Get mandate name for result message
|
||||||
mandate = rootInterface.getMandate(mandateId) if mandateId else None
|
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
|
# Check if user already has this mandate
|
||||||
existingMembership = rootInterface.getUserMandate(str(currentUser.id), mandateId) if mandateId else None
|
existingMembership = rootInterface.getUserMandate(str(currentUser.id), mandateId) if mandateId else None
|
||||||
|
|
|
||||||
|
|
@ -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
|
# Get mandate name for notification using interface method
|
||||||
mandateId = invitation.mandateId
|
mandateId = invitation.mandateId
|
||||||
mandate = appInterface.getMandate(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
|
# Get inviter name
|
||||||
inviterId = invitation.createdBy
|
inviterId = invitation.createdBy
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue