Skip to content

Commit 9b6bb22

Browse files
committed
Migrate project related stuff to format_project_table
1 parent ed98778 commit 9b6bb22

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

qfieldcloud_sdk/cli.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,8 @@ def list_projects(ctx: Context, include_public: bool, **opts) -> None:
200200
print_json(projects)
201201
else:
202202
if projects:
203-
log("Projects:")
204-
for project in projects:
205-
log(f'{project["id"]}\t{project["owner"]}/{project["name"]}')
203+
log("Projects the current user has access to:")
204+
log(format_project_table(projects))
206205
else:
207206
log("User does not have any projects yet.")
208207

@@ -258,9 +257,8 @@ def create_project(ctx: Context, name, owner, description, is_public):
258257
if ctx.obj["format_json"]:
259258
print_json(project)
260259
else:
261-
log(
262-
f'Created project "{project["owner"]}/{project["name"]}" with project id "{project["id"]}".'
263-
)
260+
log("Created project:")
261+
log(format_project_table([project]))
264262

265263

266264
@cli.command()

0 commit comments

Comments
 (0)