@@ -37,10 +37,12 @@ def caltechdata_accept(ids, token=None, production=False):
3737 url + "/api/records/" + idv + "/draft/review" , headers = headers
3838 )
3939 if result .status_code != 200 :
40- result = requests .get (url + "/api/records/" + idv + '/requests' , headers = headers )
40+ result = requests .get (
41+ url + "/api/records/" + idv + "/requests" , headers = headers
42+ )
4143 if result .status_code != 200 :
4244 raise Exception (result .text )
43- accept_link = result .json ()["hits" ]["hits" ][0 ]["links" ]["actions" ]["accept" ]
45+ accept_link = result .json ()["hits" ]["hits" ][0 ]["links" ]["actions" ]["accept" ]
4446 else :
4547 accept_link = result .json ()["links" ]["actions" ]["accept" ]
4648 data = comment = {
@@ -151,12 +153,12 @@ def caltechdata_edit(
151153 "Content-type" : "application/octet-stream" ,
152154 }
153155
154- #Add to community if provided:
156+ # Add to community if provided:
155157 if community :
156158 result = requests .post (
157159 url + "/api/records/" + idv + "/communities" ,
158160 headers = headers ,
159- data = json .dumps ({"communities" :[{"id" : community }]}),
161+ data = json .dumps ({"communities" : [{"id" : community }]}),
160162 )
161163 if result .status_code != 200 :
162164 print (result .url )
@@ -332,7 +334,7 @@ def caltechdata_edit(
332334 )
333335 if file_links :
334336 ex_file = existing ["files" ]["entries" ].keys ()
335- #At the moment we don't replace existing links. This needs to change
337+ # At the moment we don't replace existing links. This needs to change
336338 for link in file_links :
337339 file = link .split ("/" )[- 1 ]
338340 if file not in ex_file :
0 commit comments