Skip to content

Commit

Permalink
Merge pull request #3086 from OpenNeuroOrg/empty-snapshot-bug
Browse files Browse the repository at this point in the history
fix(worker): Allow commit summaries (snapshot API) with no files
  • Loading branch information
nellh authored Jun 22, 2024
2 parents 79b32ba + 598b5b2 commit b9a3b15
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions services/datalad/datalad_service/handlers/snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@ def on_get(self, req, resp, dataset, snapshot=None):
resp.status = falcon.HTTP_NOT_FOUND
elif snapshot:
files = get_tree(self.store, dataset, snapshot)
if files:
try:
response = get_snapshot(self.store, dataset, snapshot)
response['files'] = files
resp.media = response
resp.status = falcon.HTTP_OK
except KeyError:
# Tree returned objects but does not exist?
resp.status = falcon.HTTP_NOT_FOUND
else:
try:
response = get_snapshot(self.store, dataset, snapshot)
response['files'] = files
resp.media = response
resp.status = falcon.HTTP_OK
except KeyError:
# Tree returned objects but does not exist?
resp.status = falcon.HTTP_NOT_FOUND
else:
tags = get_snapshots(self.store,
Expand Down

0 comments on commit b9a3b15

Please sign in to comment.