From: Carl Worth Date: Sat, 8 Jan 2022 08:27:11 +0000 (-0800) Subject: puzzle_copy: Copy the solution list as well X-Git-Url: https://git.cworth.org/git?p=turbot;a=commitdiff_plain;h=cab4e4b9d7a0c37e988765c723a135739a3a3112 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. --- 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