Skip to content

Commit f3c033f

Browse files
committed
Fix log
1 parent 6ed0153 commit f3c033f

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

src/superannotate/lib/app/interface/sdk_interface.py

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,18 +2245,17 @@ def attach_image_urls_to_project(
22452245
raise AppException(LIMITED_FUNCTIONS[project["project"].project_type])
22462246

22472247
images_to_upload, duplicate_images = get_paths_and_duplicated_from_csv(attachments)
2248-
if len(duplicate_images):
2249-
logger.warning(
2250-
constances.ALREADY_EXISTING_FILES_WARNING.format(len(duplicate_images))
2251-
)
2252-
logger.info(constances.ATTACHING_FILES_MESSAGE.format(len(images_to_upload),project_folder_name))
2253-
22542248
use_case = controller.interactive_attach_urls(
22552249
project_name=project_name,
22562250
folder_name=folder_name,
22572251
files=ImageSerializer.deserialize(images_to_upload), # noqa: E203
22582252
annotation_status=annotation_status,
22592253
)
2254+
if len(duplicate_images):
2255+
logger.warning(
2256+
constances.ALREADY_EXISTING_FILES_WARNING.format(len(duplicate_images))
2257+
)
2258+
logger.info(constances.ATTACHING_FILES_MESSAGE.format(len(images_to_upload),project_folder_name))
22602259
if use_case.is_valid():
22612260
with tqdm(
22622261
total=use_case.attachments_count, desc="Attaching urls"
@@ -2299,18 +2298,17 @@ def attach_video_urls_to_project(
22992298
raise AppException(LIMITED_FUNCTIONS[project["project"].project_type])
23002299

23012300
images_to_upload, duplicate_images = get_paths_and_duplicated_from_csv(attachments)
2302-
if len(duplicate_images):
2303-
logger.warning(
2304-
constances.ALREADY_EXISTING_FILES_WARNING.format(len(duplicate_images))
2305-
)
2306-
logger.info(constances.ATTACHING_FILES_MESSAGE.format(len(images_to_upload),project_folder_name))
2307-
23082301
use_case = controller.interactive_attach_urls(
23092302
project_name=project_name,
23102303
folder_name=folder_name,
23112304
files=ImageSerializer.deserialize(images_to_upload), # noqa: E203
23122305
annotation_status=annotation_status,
23132306
)
2307+
if len(duplicate_images):
2308+
logger.warning(
2309+
constances.ALREADY_EXISTING_FILES_WARNING.format(len(duplicate_images))
2310+
)
2311+
logger.info(constances.ATTACHING_FILES_MESSAGE.format(len(images_to_upload),project_folder_name))
23142312
if use_case.is_valid():
23152313
with tqdm(
23162314
total=use_case.attachments_count, desc="Attaching urls"
@@ -3516,17 +3514,17 @@ def attach_document_urls_to_project(
35163514

35173515
images_to_upload, duplicate_images = get_paths_and_duplicated_from_csv(attachments)
35183516

3519-
if len(duplicate_images):
3520-
logger.warning(
3521-
constances.ALREADY_EXISTING_FILES_WARNING.format(len(duplicate_images))
3522-
)
3523-
logger.info(constances.ATTACHING_FILES_MESSAGE.format(len(images_to_upload),project_folder_name))
35243517
use_case = controller.interactive_attach_urls(
35253518
project_name=project_name,
35263519
folder_name=folder_name,
35273520
files=ImageSerializer.deserialize(images_to_upload), # noqa: E203
35283521
annotation_status=annotation_status,
35293522
)
3523+
if len(duplicate_images):
3524+
logger.warning(
3525+
constances.ALREADY_EXISTING_FILES_WARNING.format(len(duplicate_images))
3526+
)
3527+
logger.info(constances.ATTACHING_FILES_MESSAGE.format(len(images_to_upload),project_folder_name))
35303528
if use_case.is_valid():
35313529
with tqdm(
35323530
total=use_case.attachments_count, desc="Attaching urls"

0 commit comments

Comments
 (0)