From cab4e4b9d7a0c37e988765c723a135739a3a3112 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sat, 8 Jan 2022 00:27:11 -0800 Subject: [PATCH] puzzle_copy: Copy the solution list as well 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/turbot/puzzle.py b/turbot/puzzle.py index abfe60b..caf6ced 100644 --- a/turbot/puzzle.py +++ b/turbot/puzzle.py @@ -357,4 +357,7 @@ def puzzle_copy(old_puzzle): 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 -- 2.43.0