Skip to content

Commit 96f056c

Browse files
committed
BF: strip away any prefix before ":" while determining numeric dandiset identifier
We have it confusing, as the identifier in the client model is just the numeric part. We should have called it differently from the metadata model identifier
1 parent 45c679a commit 96f056c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dandi/dandiset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ def _get_identifier(metadata: dict) -> str | None:
139139
id_ = str(id_.get("value", ""))
140140
elif id_ is not None:
141141
assert isinstance(id_, str)
142-
if id_.startswith("DANDI:"):
143-
# result of https://github.com/dandi/dandi-cli/pull/348 which
144-
id_ = id_[len("DANDI:") :]
142+
# result of https://github.com/dandi/dandi-cli/pull/348 which ???
143+
# TODO: RF to avoid this evil!!!
144+
id_ = id_.split(":")[-1]
145145

146146
assert id_ is None or isinstance(id_, str)
147147
return id_

0 commit comments

Comments
 (0)