From: Carl Worth Date: Fri, 1 Jan 2021 18:42:14 +0000 (-0800) Subject: Make /solved clear the state string for a puzzle X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=9fa66872a067d0cf4f580e36ba24761c5634f014;p=turbot Make /solved clear the state string for a puzzle In the last test we run, we often saw stale state messages about a puzzle being half-solve, etc. when it was actually already completely solved. Instead of putting another chore onto solvers to have them manually clear the state string after solving a puzzle, here we do that automatically. This completes another low-hanging fruit item from the TODO list. --- diff --git a/TODO b/TODO index 67a4830..dc5b41c 100644 --- a/TODO +++ b/TODO @@ -3,14 +3,6 @@ Recently-proposed ideas (not yet prioritized) • Set-up an announcements Slack channel that's auto fed by email to a particular email address. -Low-hanging fruit ------------------ - -[These are not highest priority, but are so easy that they are worth -not delaying until after bigger features below.] - -• Make /solved clear the state string for a puzzle. - Round management ---------------- diff --git a/turbot/interaction.py b/turbot/interaction.py index f2a35ee..8ccd247 100644 --- a/turbot/interaction.py +++ b/turbot/interaction.py @@ -567,6 +567,7 @@ def solved(turb, body, args): # Set the status and solution fields in the database puzzle['status'] = 'solved' puzzle['solution'].append(args) + del puzzle['state'] turb.table.put_item(Item=puzzle) # Report the solution to the puzzle's channel