Skip to content

Commit 1ad452d

Browse files
authored
Merge pull request #87 from spwoodcock/patch-1
Avoid double login for 'login' subcommand in CLI
2 parents f343e62 + d7558c7 commit 1ad452d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

qfieldcloud_sdk/cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ def cli(
133133
ctx.obj["format_json"] = format_json
134134

135135
if username or password:
136-
ctx.obj["client"].login(username, password)
136+
# Guard against parent 'pre-login' for login subcommand
137+
if ctx.invoked_subcommand != "login":
138+
ctx.obj["client"].login(username, password)
137139

138140

139141
@cli.command()

0 commit comments

Comments
 (0)