Skip to content

Commit a76e979

Browse files
Merge pull request #283 from BMDSoftware/fix/duplicate_files_on_null_uploaded_file
Add verification of pending upload file in Duplicate file verification
2 parents 100dc58 + 59eec38 commit a76e979

File tree

1 file changed

+3
-6
lines changed
  • dashboard_viewer/uploader/file_handler

1 file changed

+3
-6
lines changed

dashboard_viewer/uploader/file_handler/checks.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,8 @@ def _get_upload_attr(analysis, stratum):
270270

271271

272272
def check_for_duplicated_files(uploaded_file, data_source_id):
273-
#### Added For Checksum ##########################
274-
275273
try:
276-
# Upload History only stores the succesded files
274+
# Upload History only stores the succeded files
277275

278276
pd = UploadHistory.objects.filter(data_source_id=data_source_id).latest()
279277

@@ -283,8 +281,8 @@ def check_for_duplicated_files(uploaded_file, data_source_id):
283281
.first()
284282
)
285283

286-
if data_source_hash is not None:
287-
# Go to the path where sucess filea are stored
284+
if data_source_hash is not None and bool(pd.uploaded_file):
285+
# Go to the path where success files are stored
288286

289287
latest_file_path = os.path.join(settings.MEDIA_ROOT, pd.uploaded_file.path)
290288

@@ -317,7 +315,6 @@ def check_for_duplicated_files(uploaded_file, data_source_id):
317315
except UploadHistory.DoesNotExist:
318316
pass
319317

320-
#### Added For Checksum ##########################
321318

322319
def upload_data_to_tmp_table(data_source_id, file_metadata, pending_upload):
323320

0 commit comments

Comments
 (0)