Enable a more safe mode of creation

This commit is contained in:
decentral1se 2021-08-12 12:15:47 +02:00
parent d05d812189
commit c12ee79458
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC

View File

@ -61,8 +61,13 @@ for email in emails:
"requiredActions": ["UPDATE_PASSWORD", "UPDATE_PROFILE"], "requiredActions": ["UPDATE_PASSWORD", "UPDATE_PROFILE"],
} }
print(f"payload: {payload}")
if not confirm():
print("Bailing out on request...")
exit(1)
try: try:
user_id = keycloak.create_user(payload, exist_ok=False) user_id = keycloak.create_user(payload, exist_ok=True)
print(f"Account created for {email}") print(f"Account created for {email}")
keycloak.send_verify_email(user_id=user_id) keycloak.send_verify_email(user_id=user_id)
print(f"Verification mail sent to {email}") print(f"Verification mail sent to {email}")