diff --git a/cope2n-api/fwd_api/celery_worker/internal_task.py b/cope2n-api/fwd_api/celery_worker/internal_task.py index 20a77ac..d79bca8 100755 --- a/cope2n-api/fwd_api/celery_worker/internal_task.py +++ b/cope2n-api/fwd_api/celery_worker/internal_task.py @@ -99,11 +99,10 @@ def process_pdf(rq_id, sub_id, p_type, user_id, files): _b_urls = process_pdf_file(file["file_name"], file["file_path"], new_request, user) if _b_urls is None: raise FileContentInvalidException - for i in range(len(_b_urls)): - _b_urls[i]["doc_type"] = file["file_type"] - # b_urls += _b_urls # TODO: Client may request all images in a file, for now, extract the first page only - for j in range(len(b_urls)): + for j in range(len(_b_urls)): + _b_urls[j]["doc_type"] = file["file_type"] _b_urls[j]["page_number"] = j + len(b_urls) + # b_urls += _b_urls # TODO: Client may request all images in a file, for now, extract the first page only b_urls.append(_b_urls[0]) elif extension in image_extensions: this_url = ProcessUtil.process_image_local_file(file["file_name"], file["file_path"], new_request, user)[0]