Skip to content

Commit

Permalink
first /
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed Jul 3, 2024
1 parent 1cf9f18 commit 233f716
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/anemoi/registry/commands/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ def check_arguments(self, args):

def run(self, args):
path = args.path
if "/" not in path:
if "/" not in path[1:] or not path.startswith("/"):
raise ValueError("Invalid API path {path}")
collection, *_ = path.split("/")

_, collection, *_ = path.split("/")
if collection not in ("datasets", "experiments", "weights", "queues"):
LOG.warning(f"Unknown collection {collection}")

Expand Down Expand Up @@ -192,7 +193,7 @@ def load(self, args):
LOG.error(f"Entry in {args.path} does not exists. Using --create to create it.")
raise ValueError(f"Entry in {args.path} does not exists. Using --create to create it.")

collection, _ = args.path.split("/")
_, collection, *_ = args.path.split("/")
res = rest.post(collection, edited)
LOG.info(f"Entry in {collection} has been created : {res}.")

Expand Down

0 comments on commit 233f716

Please sign in to comment.