Skip to content
This repository was archived by the owner on Dec 8, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions CodeChallenge/cli/questions.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def q_add(title, answer, rank, asset, hint1, hint2):
ANSWER is the answer stored only in the database
RANK is the day rank the queestion should be revealed on
ASSET is a path to a file to upload for a question
HINT1 is a hint string
HINT1 is a hint string
HINT2 is a hint string
"""

Expand Down Expand Up @@ -124,7 +124,6 @@ def q_sync():

with click.progressbar(rows, label="synchronizing with CSV data ...") as bar:
for i, row in enumerate(bar):

if not all((row["rank"], row["title"],
row["answer"], row["asset"])):
errors.append(f"invalid row {i} (missing rank/title/answer/asset)")
Expand Down Expand Up @@ -155,7 +154,7 @@ def q_sync():
r2 = requests.get(row["asset"], stream=True)
if not r2.ok:
errors.append(f"failed to download asset for row {i+1}: {row['asset']}")
return
continue

for chunk in r2.iter_content(1024):
b.write(chunk)
Expand Down