Skip to content

Commit 6b44ab1

Browse files
authored
Fix names for project and collection in run_parser (#174)
Replacing project and collection name with uppercase and underscores
1 parent 6fd6f83 commit 6b44ab1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bam_masterdata/cli/cli.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,8 +623,9 @@ def run_parser(
623623
if project_name.upper() in [p.code for p in space.get_projects()]:
624624
project = space.get_project(project_name)
625625
else:
626+
logger.info("Replacing project code with uppercase and underscores.")
626627
project = space.new_project(
627-
code=project_name,
628+
code=project_name.replace(" ", "_").upper(),
628629
description="New project created via automated parsing with `bam_masterdata`.",
629630
)
630631
project.save()
@@ -635,8 +636,9 @@ def run_parser(
635636
f"/{openbis.username}/{project_name}/{collection_name}".upper()
636637
)
637638
else:
639+
logger.info("Replacing collection code with uppercase and underscores.")
638640
collection_openbis = openbis.new_collection(
639-
code=collection_name,
641+
code=collection_name.replace(" ", "_").upper(),
640642
type="COLLECTION",
641643
project=project,
642644
)

0 commit comments

Comments
 (0)