Skip to content

Commit e1ba815

Browse files
authored
Fix get command with Django (#804)
Fix #789
1 parent a55cdba commit e1ba815

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

dynaconf/cli.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def set_settings(ctx, instance=None):
4343

4444
settings = None
4545

46+
_echo_enabled = ctx.invoked_subcommand not in ["get", None]
47+
4648
if instance is not None:
4749
if ctx.invoked_subcommand in ["init"]:
4850
raise click.UsageError(
@@ -57,7 +59,7 @@ def set_settings(ctx, instance=None):
5759

5860
flask_app = ScriptInfo().load_app()
5961
settings = FlaskDynaconf(flask_app, **flask_app.config).settings
60-
click.echo(
62+
_echo_enabled and click.echo(
6163
click.style(
6264
"Flask app detected", fg="white", bg="bright_black"
6365
)
@@ -73,7 +75,7 @@ def set_settings(ctx, instance=None):
7375
settings = LazySettings()
7476

7577
if settings is not None:
76-
click.echo(
78+
_echo_enabled and click.echo(
7779
click.style(
7880
"Django app detected", fg="white", bg="bright_black"
7981
)

0 commit comments

Comments
 (0)