diff --git a/api/scpca_portal/models/computed_file.py b/api/scpca_portal/models/computed_file.py index f0b88c6e..d032645b 100644 --- a/api/scpca_portal/models/computed_file.py +++ b/api/scpca_portal/models/computed_file.py @@ -154,9 +154,7 @@ def get_project_file(cls, project, download_config: Dict) -> Self | None: libraries = project.get_libraries(download_config) # If the query returns empty, then throw an error occurred. if not libraries.exists(): - raise ValueError( - "Invalid request: no libraries exist with this project-download_config combination." - ) + raise ValueError("Unable to find libraries for download_config.") libraries_metadata = [ lib_md for library in libraries for lib_md in library.get_combined_library_metadata() @@ -230,9 +228,7 @@ def get_sample_file(cls, sample, download_config: Dict) -> Self | None: libraries = sample.get_libraries(download_config) # If the query returns empty, then throw an error occurred. if not libraries.exists(): - raise ValueError( - "Invalid request: no libraries exist with this sample-download_config combination." - ) + raise ValueError("Unable to find libraries for download_config.") libraries_metadata = [ lib_md for library in libraries for lib_md in library.get_combined_library_metadata() diff --git a/api/scpca_portal/models/project.py b/api/scpca_portal/models/project.py index e9ad7344..3d12caf0 100644 --- a/api/scpca_portal/models/project.py +++ b/api/scpca_portal/models/project.py @@ -209,7 +209,7 @@ def get_libraries(self, download_config: Dict = {}): # -> QuerySet[Library]: return self.libraries.all() if download_config not in common.PROJECT_DOWNLOAD_CONFIGS.values(): - raise ValueError("Invalid download configuration passed. Unable to retrieve libraries.") + raise ValueError("Invalid download_config passed. Unable to retrieve libraries.") # You cannot include multiplexed when there are no multiplexed libraries if not download_config["excludes_multiplexed"] and not self.has_multiplexed_data: diff --git a/api/scpca_portal/models/sample.py b/api/scpca_portal/models/sample.py index b6915938..c9f9e4f5 100644 --- a/api/scpca_portal/models/sample.py +++ b/api/scpca_portal/models/sample.py @@ -145,7 +145,7 @@ def get_libraries(self, download_config: Dict = {}): # -> QuerySet[Library]: return self.libraries.all() if download_config not in common.SAMPLE_DOWNLOAD_CONFIGS.values(): - raise ValueError("Invalid download configuration passed. Unable to retrieve libraries.") + raise ValueError("Invalid download_config passed. Unable to retrieve libraries.") return self.libraries.filter( modality=download_config["modality"],