File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,15 @@ def navigate_url(url):
48
48
client = DandiAPIClient (server_url )
49
49
if asset_id ["version" ] is None :
50
50
r = client .get (f"/dandisets/{ asset_id ['dandiset_id' ]} /" )
51
- asset_id ["version" ] = r ["most_recent_version" ]["version" ]
51
+ if "draft_version" in r :
52
+ asset_id ["version" ] = r ["draft_version" ]["version" ]
53
+ published_version = r ["most_recent_published_version" ]
54
+ if published_version :
55
+ asset_id ["version" ] = published_version ["version" ]
56
+ else :
57
+ # TODO: remove `if` after https://github.com/dandi/dandi-api/pull/219
58
+ # is merged/deployed
59
+ asset_id ["version" ] = r ["most_recent_version" ]["version" ]
52
60
args = (asset_id ["dandiset_id" ], asset_id ["version" ])
53
61
kwargs ["include_metadata" ] = True
54
62
if asset_id .get ("location" ) or asset_id .get ("asset_id" ):
You can’t perform that action at this time.
0 commit comments