Skip to content

Commit

Permalink
ensure concept_id does not end with '/'
Browse files Browse the repository at this point in the history
  • Loading branch information
FynnBe committed May 27, 2024
1 parent 0afd542 commit 153108d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bioimageio_collection_backoffice/remote_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def lock_concept(
@wraps(func)
def wrapper(self: R, *args: P.args, **kwargs: P.kwargs):
concept_id = self.concept_id
assert not concept_id.endswith("/"), concept_id
lock_path = f"{concept_id}/concept-lock"
if list(self.client.ls(lock_path)):
raise ValueError(f"{concept_id} is currently locked")
Expand Down Expand Up @@ -469,6 +470,7 @@ class RecordBase(RemoteBase, ABC):

def __post_init__(self):
self.concept_id = self.concept_id.strip("/")
assert self.concept_id, "missing concept_id"
self.concept = RecordConcept(client=self.client, concept_id=self.concept_id)

@property
Expand Down Expand Up @@ -544,7 +546,7 @@ def folder(self) -> str:

@property
def id(self) -> str:
return f"{self.concept.id}/draft"
return f"{self.concept_id}/draft"

@property
def info(self) -> DraftInfo:
Expand Down

0 comments on commit 153108d

Please sign in to comment.