Skip to content

Commit

Permalink
Use select_for_update when updating dandiset version
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnesbitt committed Jul 19, 2024
1 parent bc1be9b commit 720018b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dandiapi/api/services/embargo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def unembargo_dandiset(ds: Dandiset):

# Fetch version to ensure changed embargo_status is included
# Save version to update metadata through populate_metadata
v = Version.objects.get(dandiset=ds, version='draft')
v = Version.objects.select_for_update().get(dandiset=ds, version='draft')
v.save()
logger.info('Version metadata updated')

Expand Down

0 comments on commit 720018b

Please sign in to comment.