@@ -556,7 +556,8 @@ def update_or_create(self, parent_id, title, body):
556
556
result = self .create_page (space = space , parent_id = parent_id , title = title , body = body )
557
557
558
558
log .info ('You may access your page at: {host}{url}' .format (host = self .url ,
559
- url = result ['_links' ]['tinyui' ]))
559
+ url = ((result or {})
560
+ .get ('_links' ) or {}).get ('tinyui' )))
560
561
return result
561
562
562
563
def convert_wiki_to_storage (self , wiki ):
@@ -875,7 +876,7 @@ def delete_plugin(self, plugin_key):
875
876
url = 'rest/plugins/1.0/{}-key' .format (plugin_key )
876
877
return self .delete (url )
877
878
878
- def check_long_task_result (self , start , limit , expand ):
879
+ def check_long_tasks_result (self , start , limit , expand ):
879
880
"""
880
881
Get result of long tasks
881
882
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
@@ -893,6 +894,18 @@ def check_long_task_result(self, start, limit, expand):
893
894
params ['limit' ] = limit
894
895
return self .get ('rest/api/longtask' , params = params )
895
896
897
+ def check_long_task_result (self , task_id , expand ):
898
+ """
899
+ Get result of long tasks
900
+ :param task_id: task id
901
+ :param expand:
902
+ :return:
903
+ """
904
+ params = None
905
+ if expand :
906
+ params = {'expand' : expand }
907
+ return self .get ('rest/api/longtask/{}' .format (task_id ), params = params )
908
+
896
909
def get_pdf_download_url_for_confluence_cloud (self , url ):
897
910
"""
898
911
Confluence cloud does not return the PDF document when the PDF
0 commit comments