From 5ec5714dee97db2e2eebe996480f787dcf08deb1 Mon Sep 17 00:00:00 2001 From: John Hammond Date: Thu, 16 Jul 2020 19:35:36 -0400 Subject: [PATCH] Fixed after `sync` the challenge will return to visible if `state` is not set in challenge.yml --- ctfcli/utils/challenge.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ctfcli/utils/challenge.py b/ctfcli/utils/challenge.py index a0c8cf4..db8eb94 100644 --- a/ctfcli/utils/challenge.py +++ b/ctfcli/utils/challenge.py @@ -154,6 +154,8 @@ def sync_challenge(challenge, path = None): if challenge.get("state"): if challenge["state"] in ["hidden", "visible"]: data["state"] = challenge["state"] + else: + data["state"] = "visible" r = s.patch(f"/api/v1/challenges/{challenge_id}", json=data) r.raise_for_status()