@@ -2742,11 +2742,11 @@ def get_space_export(self, space_key: str, export_type: str) -> str:
27422742 :return: The URL to download the exported file.
27432743 """
27442744
2745- def get_atl_request (url : str ):
2745+ def get_atl_request (link : str ):
27462746 # Nested function used to get atl_token used for XSRF protection.
27472747 # This is only applicable to html/csv/xml space exports
27482748 try :
2749- response = self .get (url , advanced_mode = True )
2749+ response = self .get (link , advanced_mode = True )
27502750 parsed_html = BeautifulSoup (response .text , "html.parser" )
27512751 atl_token = parsed_html .find ("input" , {"name" : "atl_token" }).get ("value" ) # type: ignore[union-attr]
27522752 return atl_token
@@ -2806,11 +2806,10 @@ def get_atl_request(url: str):
28062806 running_task = True
28072807 while running_task :
28082808 try :
2809- progress_response = self .get (poll_url )
2810- assert progress_response
2811- log .info ("Space" + space_key + " export status: " + progress_response ["message" ])
2812- if progress_response ["complete" ]:
2813- parsed_html = BeautifulSoup (progress_response ["message" ], "html.parser" )
2809+ progress_response = self .get (poll_url ) or {}
2810+ log .info (f"Space { space_key } export status: { progress_response .get ('message' , 'None' )} " )
2811+ if progress_response is not {} and progress_response .get ("complete" ):
2812+ parsed_html = BeautifulSoup (progress_response .get ("message" ), "html.parser" )
28142813 download_url = cast ("str" , parsed_html .find ("a" , {"class" : "space-export-download-path" }).get ("href" )) # type: ignore
28152814 if self .url in download_url :
28162815 return download_url
0 commit comments