Skip to content
Snippets Groups Projects
Commit 1a54af52 authored by Arie Peterson's avatar Arie Peterson
Browse files

Merge branch '210-users-created-via-cli-are-broken' into 'main'

Resolve "Users created via CLI are broken"

Closes #210

See merge request !187
parents da6af273 240d449b
No related branches found
No related tags found
1 merge request!187Resolve "Users created via CLI are broken"
Pipeline #46202 passed with stages
in 4 minutes and 37 seconds
......@@ -359,6 +359,20 @@ def create_user(email):
user.email = email
user.save()
dashboard_app = db.session.query(App).filter(App.slug == 'dashboard').first()
if not dashboard_app:
print("Dashboard app not found. Aborting.")
sys.exit(1)
user_role = Role.query.filter(func.lower(Role.name) == 'user').first()
if not user_role:
print("User role not found. Aborting.")
sys.exit(1)
UserService.set_user_role(user.uuid, dashboard_app.id, user_role.id)
db.session.commit()
@user_cli.command("setpassword")
@click.argument("email")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment