From 7efaf830a15f0b10862ec407130214e549be0454 Mon Sep 17 00:00:00 2001 From: RayPlante Date: Tue, 10 Sep 2024 06:09:51 -0400 Subject: [PATCH] midas3.py MIDASSIP.fromPOD bug fix: proper handling of uploaddir override --- python/nistoar/pdr/preserv/bagger/midas3.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python/nistoar/pdr/preserv/bagger/midas3.py b/python/nistoar/pdr/preserv/bagger/midas3.py index 65d66188..8e914a1c 100644 --- a/python/nistoar/pdr/preserv/bagger/midas3.py +++ b/python/nistoar/pdr/preserv/bagger/midas3.py @@ -165,9 +165,11 @@ def fromNERD(cls, nerdrec, reviewdir, uploaddir=None): recnum = _midadid_to_dirname(midasid) revdir = os.path.join(reviewdir, recnum) - upldir = os.path.join(uploaddir, recnum) - if not os.path.isdir(upldir): - upldir = None + upldir = None + if uploaddir: + upldir = os.path.join(uploaddir, recnum) + if not os.path.isdir(upldir): + upldir = None out = cls(nerd.get('ediid'), revdir, upldir, nerdrec=nerd)