email template
This commit is contained in:
parent
ebbb582e99
commit
2451045693
15 changed files with 447 additions and 156 deletions
|
|
@ -154,10 +154,16 @@ async def create_org_member(
|
|||
org_role=payload.org_role,
|
||||
member_status=member_status,
|
||||
invitation_email=invitation_email,
|
||||
must_change_password=payload.force_password_change,
|
||||
must_change_password=(
|
||||
payload.force_password_change if not payload.send_invitation else False
|
||||
),
|
||||
section_id=section.id if section else None,
|
||||
created_by_id=manager.id,
|
||||
password_hash=password_hasher.hash(payload.password),
|
||||
password_hash=password_hasher.hash(
|
||||
payload.password
|
||||
if payload.password
|
||||
else secrets.token_urlsafe(48)
|
||||
),
|
||||
)
|
||||
session.add(member)
|
||||
await session.flush()
|
||||
|
|
@ -171,8 +177,6 @@ async def create_org_member(
|
|||
session,
|
||||
member=member,
|
||||
manager=manager,
|
||||
initial_password=payload.password,
|
||||
force_password_change=payload.force_password_change,
|
||||
)
|
||||
invitation_sent = True
|
||||
except Exception as error:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue