Allow for grabbing of single kit if only one exists for submission type.
This commit is contained in:
@@ -683,6 +683,11 @@ class SubmissionType(BaseClass):
|
||||
"""
|
||||
return f"<SubmissionType({self.name})>"
|
||||
|
||||
@classmethod
|
||||
def retrieve_template_file(cls):
|
||||
submission_type = cls.query(name="Bacterial Culture")
|
||||
return submission_type.template_file
|
||||
|
||||
def get_template_file_sheets(self) -> List[str]:
|
||||
logger.debug(f"Submission type to get sheets for: {self.name}")
|
||||
"""
|
||||
@@ -779,6 +784,12 @@ class SubmissionType(BaseClass):
|
||||
tmap = {}
|
||||
yield item.tip_role.name, tmap
|
||||
|
||||
def get_default_kit(self) -> KitType | None:
|
||||
if len(self.kit_types) == 1:
|
||||
return self.kit_types[0]
|
||||
else:
|
||||
return None
|
||||
|
||||
def get_equipment(self, extraction_kit: str | KitType | None = None) -> Generator['PydEquipmentRole', None, None]:
|
||||
"""
|
||||
Returns PydEquipmentRole of all equipment associated with this SubmissionType
|
||||
|
||||
Reference in New Issue
Block a user