Skip to content

Commit

Permalink
fixed logic for None input
Browse files Browse the repository at this point in the history
  • Loading branch information
TheChymera committed May 13, 2022
1 parent 46bcdb1 commit d508c7b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions dandi/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ def upload(
dandiset_ = Dandiset.find(os.path.commonpath(paths))
else:
dandiset_ = Dandiset.find(None)
if not dandiset_:
raise RuntimeError(
f"Found no {dandiset_metadata_file} anywhere in common ancestor of"
" paths. Use 'dandi download' or 'organize' first."
)

# pre-validate BIDS datasets before going for individual
# files etc
Expand All @@ -75,12 +80,6 @@ def upload(
)
allow_any_path = True

if not dandiset_:
raise RuntimeError(
f"Found no {dandiset_metadata_file} anywhere in common ancestor of"
" paths. Use 'dandi download' or 'organize' first."
)

instance = get_instance(dandi_instance)
assert instance.api is not None
api_url = instance.api
Expand Down

0 comments on commit d508c7b

Please sign in to comment.