Skip to content

Commit

Permalink
WIP: Fix RET503 Missing explicit return at the end of function able…
Browse files Browse the repository at this point in the history
… to return non-`None` value
  • Loading branch information
brianhelba committed Nov 29, 2023
1 parent 366a9a3 commit c676bcf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions dandiapi/api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def queryset(self, request, queryset):
status = self.value()
if status:
return queryset.filter(status=status)
return None


@admin.register(Version)
Expand Down
2 changes: 2 additions & 0 deletions dandiapi/api/models/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ def sha256(self):
return self.blob.sha256
elif self.is_embargoed_blob:
return self.embargoed_blob.sha256
else:
raise RuntimeError('Zarr does not support SHA256')

@property
def digest(self) -> dict[str, str]:
Expand Down
2 changes: 2 additions & 0 deletions dandiapi/api/views/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ def download(self, request, *args, **kwargs):
)

return HttpResponseRedirect(url)
else:
raise TypeError('Invalid content_disposition: %s', content_disposition)

@swagger_auto_schema(
method='GET',
Expand Down

0 comments on commit c676bcf

Please sign in to comment.