Skip to content

Commit

Permalink
fix: assign proper database name to superset user
Browse files Browse the repository at this point in the history
When running `do cairn-createuser`, the created db did not have the
right name. If the user had been created earlier with SSO, then the
Clickhouse DB did not exist.
  • Loading branch information
regisb committed Aug 19, 2023
1 parent a22f4c3 commit 80e8538
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/20230819_081659_regis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [Bugfix] Fix superset database name in user creation with `do cairn-createuser`. (by @regisb)
4 changes: 2 additions & 2 deletions tutorcairn/templates/cairn/build/cairn-superset/cairn/ctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def main():
"--database",
help=(
"Name of the Superset database to which the objects should be linked."
" By default, this will be the same as the username."
" By default, this will be the 'openedx-<username>'."
),
)
parser_dashboards.add_argument("username")
Expand All @@ -92,7 +92,7 @@ def main():
# but the "create-user" command fails if the user already exists.
def bootstrap_user(args):
# Bootstrap database
database_name = args.db or args.username
database_name = args.db or f"openedx-{args.username}"
cairn_bootstrap.create_superset_db(args.username, database_name)

# Get or create user
Expand Down

0 comments on commit 80e8538

Please sign in to comment.