Skip to content

Commit 4ec3df2

Browse files
committed
Code cleanup
1 parent d0b02b4 commit 4ec3df2

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

superannotate/db/projects.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -819,13 +819,12 @@ def upload_images_to_project(
819819
path=f'/project/{project_id}/sdkImageUploadToken',
820820
params=params
821821
)
822-
if response.ok:
823-
res = response.json()
824-
prefix = res['filePath']
825-
else:
822+
if not response.ok:
826823
raise SABaseException(
827824
response.status_code, "Couldn't get upload token " + response.text
828825
)
826+
res = response.json()
827+
prefix = res['filePath']
829828
tqdm_thread = threading.Thread(
830829
target=__tqdm_thread_upload,
831830
args=(len_img_paths, uploaded, couldnt_upload, finish_event),
@@ -852,12 +851,12 @@ def upload_images_to_project(
852851
tqdm_thread.join()
853852
list_of_not_uploaded = []
854853
for couldnt_upload_thread in couldnt_upload:
855-
for file in couldnt_upload_thread:
856-
list_of_not_uploaded.append(str(file))
854+
for f in couldnt_upload_thread:
855+
list_of_not_uploaded.append(str(f))
857856
list_of_uploaded = []
858857
for upload_thread in uploaded:
859-
for file in upload_thread:
860-
list_of_uploaded.append(str(file))
858+
for f in upload_thread:
859+
list_of_uploaded.append(str(f))
861860

862861
return (list_of_uploaded, list_of_not_uploaded, duplicate_images)
863862

0 commit comments

Comments
 (0)