Skip to content

Commit

Permalink
Merge pull request #2019 from yarikoptic/end-doc
Browse files Browse the repository at this point in the history
../assets/{asset_id}/ PUT: clarify that new asset is created
  • Loading branch information
waxlamp committed Sep 23, 2024
2 parents 2cf0e09 + adfdde0 commit 65998f2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dandiapi/api/views/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,16 @@ def create(self, request, versions__dandiset__pk, versions__version):
request_body=AssetRequestSerializer,
responses={200: AssetDetailSerializer},
manual_parameters=[VERSIONS_DANDISET_PK_PARAM, VERSIONS_VERSION_PARAM],
operation_summary='Update the metadata of an asset.',
operation_summary='Create an asset with updated metadata.',
operation_description='User must be an owner of the associated dandiset.\
Only draft versions can be modified.',
Only draft versions can be modified.\
Old asset is returned if no updates to metadata are made.',
)
@method_decorator(
permission_required_or_403('owner', (Dandiset, 'pk', 'versions__dandiset__pk'))
)
def update(self, request, versions__dandiset__pk, versions__version, **kwargs):
"""Update the metadata of an asset."""
"""Create an asset with updated metadata."""
version: Version = get_object_or_404(
Version.objects.select_related('dandiset'),
dandiset__pk=versions__dandiset__pk,
Expand Down

0 comments on commit 65998f2

Please sign in to comment.