Skip to content

Commit 17d06cf

Browse files
committed
[close ch29937] fix key not in dict in wiki public api
1 parent 9108f26 commit 17d06cf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dataikuapi/dss/wiki.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def get_taxonomy(self):
125125
:returns: The taxonomy
126126
:rtype: list
127127
"""
128-
return self.settings["taxonomy"]
128+
return self.settings["taxonomy"] if "taxonomy" in self.settings else None
129129

130130
def __retrieve_article_in_taxonomy__(self, taxonomy, article_id, remove=False):
131131
"""
@@ -186,7 +186,7 @@ def get_home_article_id(self):
186186
:returns: The home article ID
187187
:rtype: str
188188
"""
189-
return self.settings["homeArticleId"]
189+
return self.settings["homeArticleId"] if "homeArticleId" in self.settings else None
190190

191191
def set_home_article_id(self, home_article_id):
192192
"""
@@ -270,7 +270,7 @@ def get_body(self):
270270
:returns: the article body
271271
:rtype: str
272272
"""
273-
return self.article_data["payload"]
273+
return self.article_data["payload"] if "payload" in self.article_data else None
274274

275275
def set_body(self, content):
276276
"""
@@ -288,7 +288,7 @@ def get_metadata(self):
288288
:returns: the article metadata
289289
:rtype: dict
290290
"""
291-
return self.article_data["article"]
291+
return self.article_data["article"] if "article" in self.article_data else None
292292

293293
def set_metadata(self, metadata):
294294
"""

0 commit comments

Comments
 (0)