Adaptations to allow for stand alone scripts.

This commit is contained in:
Landon Wark
2024-03-18 09:47:20 -05:00
parent 2fd8a0b9b6
commit e35081392e
7 changed files with 34 additions and 20 deletions

View File

@@ -1242,9 +1242,9 @@ class Wastewater(BasicSubmission):
outstr = super().enforce_name(instr=instr, data=data)
try:
outstr = re.sub(r"PCR(-|_)", "", outstr)
except AttributeError as e:
except (AttributeError, TypeError) as e:
logger.error(f"Problem using regex: {e}")
outstr = RSLNamer.construct_new_plate_name(instr=outstr)
outstr = RSLNamer.construct_new_plate_name(data=data)
outstr = outstr.replace("RSLWW", "RSL-WW")
outstr = re.sub(r"WW(\d{4})", r"WW-\1", outstr, flags=re.IGNORECASE)
outstr = re.sub(r"(\d{4})-(\d{2})-(\d{2})", r"\1\2\3", outstr)