Skip to content

Commit

Permalink
rubicon: Check whether referenced file exists on .dud rejection
Browse files Browse the repository at this point in the history
Otherwise rejecting fails for .dud files that reference non-existent
files.

Signed-off-by: Sebastian Krzyszkowiak <[email protected]>
  • Loading branch information
dos1 authored and ximion committed Oct 19, 2024
1 parent 8f5ef76 commit bc2867d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/rubicon/fileimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ def reject_dud_upload(
# move the files referenced by the .dud file
random_suffix = random_string(4)
for fname in dud.get_files():
if not os.path.exists(fname):
continue

target_fname = os.path.join(conf.rejected_dir, os.path.basename(fname))
if os.path.isfile(target_fname):
target_fname = target_fname + '+' + random_suffix
Expand Down

0 comments on commit bc2867d

Please sign in to comment.