]> git.cworth.org Git - turbot/commitdiff
Make /solved clear the state string for a puzzle
authorCarl Worth <cworth@cworth.org>
Fri, 1 Jan 2021 18:42:14 +0000 (10:42 -0800)
committerCarl Worth <cworth@cworth.org>
Fri, 1 Jan 2021 18:42:14 +0000 (10:42 -0800)
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
turbot/interaction.py

diff --git a/TODO b/TODO
index 67a48304218ec5fd7b77616911e726fe3a5a3107..dc5b41c0d10d077e9fa48d23376150b5e936bce4 100644 (file)
--- 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
 ----------------
 
index f2a35ee13066a8d8cdafc5c66d8f8c6db72ea134..8ccd24755af036114326b77af30de595e8cd91fe 100644 (file)
@@ -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