Skip to content

Commit 738f9dc

Browse files
ahmed-arbclaude
andcommitted
fix: don't overwrite config on non-interactive local launch
PR #1375 added a branch in interactive_configuration that applies dev defaults (LMS_HOST, CMS_HOST, ENABLE_HTTPS) whenever run_for_prod is falsy. For `tutor local launch --non-interactive`, run_for_prod is None, which is also falsy, so those three keys get clobbered to dev values on every launch — breaking production deployments that set them via `tutor config save --set ...` beforehand. Tighten the check to `run_for_prod is False` so only the explicit dev case (set in the launch command for context_name == "dev") triggers the defaults. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5afc18f commit 738f9dc

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- [Bugfix] Fix `tutor local launch --non-interactive` overwriting `LMS_HOST`, `CMS_HOST`, and `ENABLE_HTTPS` with development defaults. The dev-defaults branch added in #1375 fired whenever `run_for_prod` was falsy, including the `None` value used for `local`; it now only fires when `run_for_prod` is explicitly `False` (i.e. `tutor dev`).

tutor/commands/compose.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def interactive_configuration(
228228
config,
229229
run_for_prod=run_for_prod,
230230
)
231-
elif not run_for_prod:
231+
elif run_for_prod is False:
232232
interactive_config.set_run_mode_defaults(config)
233233
tutor_config.save_config_file(context.obj.root, config)
234234
config = tutor_config.load_full(context.obj.root)

0 commit comments

Comments
 (0)