From 9fa66872a067d0cf4f580e36ba24761c5634f014 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Fri, 1 Jan 2021 10:42:14 -0800 Subject: [PATCH] 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. --- TODO | 8 -------- turbot/interaction.py | 1 + 2 files changed, 1 insertion(+), 8 deletions(-) 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 -- 2.43.0