]> git.cworth.org Git - turbot/blobdiff - turbot/puzzle.py
Use a deep copy when comparing a puzzle to detect state modifications
[turbot] / turbot / puzzle.py
index e3a4f741580f711d0c36df9f459a265fd364b266..b361b10f3d322ce5efb43abd92c3e978e3e8c9d3 100644 (file)
@@ -293,3 +293,12 @@ def puzzle_update_channel_and_sheet(turb, puzzle, old_puzzle=None):
             channel=channel_id,
             name=channel_name
         )
+
+# A copy deep enough to work for puzzle_update_channel_and_sheet above
+def puzzle_copy(old_puzzle):
+    new_puzzle = old_puzzle.copy()
+
+    if 'tags' in old_puzzle:
+        new_puzzle['tags'] = old_puzzle['tags'].copy()
+
+    return new_puzzle