]> git.cworth.org Git - turbot/commitdiff
puzzle_copy: Copy the solution list as well
authorCarl Worth <cworth@cworth.org>
Sat, 8 Jan 2022 08:27:11 +0000 (00:27 -0800)
committerCarl Worth <cworth@cworth.org>
Sat, 8 Jan 2022 08:27:11 +0000 (00:27 -0800)
Otherwise, the new puzzle will be pointing at the old puzzle's
solution list, (and the code that looks to see if the solution list
has changed won't notice any change).

This fixes things so that using "/solved" to add a second (or third,
...) to a puzzle will now update the channel's topic, which wasn't
happening before.

turbot/puzzle.py

index abfe60b505308874109938f48f234cc2791c19a0..caf6cede14e0a86ea6e4020ee4abbfd2a8bed745 100644 (file)
@@ -357,4 +357,7 @@ def puzzle_copy(old_puzzle):
     if 'tags' in old_puzzle:
         new_puzzle['tags'] = old_puzzle['tags'].copy()
 
     if 'tags' in old_puzzle:
         new_puzzle['tags'] = old_puzzle['tags'].copy()
 
+    if 'solution' in old_puzzle:
+        new_puzzle['solution'] = old_puzzle['solution'].copy()
+
     return new_puzzle
     return new_puzzle