Skip to content

Commit 76b6733

Browse files
committed
fix stuff
1 parent bc16aec commit 76b6733

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

dataikuapi/dss/wiki.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from dataikuapi.utils import DataikuException
33
import json
44
import sys
5+
import copy
56

67
if sys.version_info >= (3,0):
78
import urllib.parse
@@ -132,6 +133,8 @@ def __retrieve_article_in_taxonomy__(self, taxonomy, article_id, remove=False):
132133
:param list taxonomy: the current level of taxonomy
133134
:param str article_id: the article to retrieve
134135
:param bool remove: either remove the sub tree structure or not
136+
:returns: the sub tree structure at a specific article level
137+
:rtype: dict
135138
"""
136139
idx = 0
137140
for tax_article in taxonomy:
@@ -151,7 +154,7 @@ def move_article_in_taxonomy(self, article_id, parent_article_id=None):
151154
:param str article_id: the main article ID
152155
:param str parent_article_id: the new parent article ID or None for root level
153156
"""
154-
old_taxonomy = list(self.settings["taxonomy"])
157+
old_taxonomy = copy.deepcopy(self.settings["taxonomy"])
155158

156159
tax_article = self.__retrieve_article_in_taxonomy__(self.settings["taxonomy"], article_id, True)
157160
if tax_article is None:
@@ -161,8 +164,8 @@ def move_article_in_taxonomy(self, article_id, parent_article_id=None):
161164
self.settings["taxonomy"].append(tax_article)
162165
else:
163166
tax_parent_article = self.__retrieve_article_in_taxonomy__(self.settings["taxonomy"], parent_article_id, False)
164-
if tax_article is None:
165-
self.settings["taonomy"] = old_taxonomy
167+
if tax_parent_article is None:
168+
self.settings["taxonomy"] = old_taxonomy
166169
raise DataikuException("Parent article not found (or is one of the article descendants): %s" % (parent_article_id))
167170
tax_parent_article["children"].append(tax_article)
168171

0 commit comments

Comments
 (0)