X-Git-Url: https://git.cworth.org/git?p=turbot;a=blobdiff_plain;f=turbot%2Finteraction.py;h=417066aba650324fd3ff0199311552f94bb16214;hp=8ae4a53556d45542ec19dca22471e46b89f8f702;hb=4ed02dad3ef9127fd1146753e93334b6c33389de;hpb=8835a45a1b898b96456f8e036299a8cb35741ba9 diff --git a/turbot/interaction.py b/turbot/interaction.py index 8ae4a53..417066a 100644 --- a/turbot/interaction.py +++ b/turbot/interaction.py @@ -197,6 +197,15 @@ def edit_puzzle_submission(turb, payload, metadata): sol.strip() for sol in solution.split(',') ] + # Verify that there's a solution if the puzzle is mark solved + if puzzle['status'] == 'solved' and not puzzle['solution']: + return submission_error("solution", + "A solved puzzle requires a solution.") + + if puzzle['status'] == 'unsolved' and puzzle['solution']: + return submission_error("solution", + "An unsolved puzzle should have no solution.") + # Add any new rounds to the database if new_rounds: if 'rounds' not in puzzle: