add admins

This commit is contained in:
2025-11-11 19:03:48 -03:00
parent 39aedac972
commit fa87cf3e07
14 changed files with 219 additions and 12 deletions

View File

@@ -77,6 +77,7 @@ def add(user: User):
cond_expr='attribute_not_exists(sk)',
exc_cls=CPFConflictError,
)
transact.put(
item={
'id': 'email',
@@ -91,12 +92,22 @@ def add(user: User):
item={
'sk': '0',
'tenant_id': {org.id},
'email_verified': False,
# Post-migration: uncomment the following line
# 'createDate': now_,
'createDate': now_,
}
| user.model_dump()
)
transact.put(
item={
'id': user_id,
'sk': f'emails#{user.email}',
'email_verified': False,
'email_primary': True,
'created_at': now_,
}
)
transact.put(
item={
'id': user.id,