Fixed after `sync` the challenge will return to visible if `state` is not set in challenge.yml

snyk-fix-a7c55a70785571b89a3356e1d875334d
John Hammond 2020-07-16 19:35:36 -04:00
parent 6d3fa304dc
commit 5ec5714dee
1 changed files with 2 additions and 0 deletions

View File

@ -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()