diff --git a/toot/cli/post.py b/toot/cli/post.py index 3daf911..d6bbb66 100644 --- a/toot/cli/post.py +++ b/toot/cli/post.py @@ -184,10 +184,11 @@ def post( poll_hide_totals=poll_hide_totals, ) + status = response.json() + if json: click.echo(response.text) else: - status = response.json() if "scheduled_at" in status: scheduled_at = parse_datetime(status["scheduled_at"]) scheduled_at = datetime.strftime(scheduled_at, "%Y-%m-%d %H:%M:%S%z") @@ -195,7 +196,7 @@ def post( else: click.echo(f"Toot posted: {status['url']}") - save_last_post_id(app, user, status["id"]) + save_last_post_id(app, user, status["id"]) delete_tmp_status_file()