Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lock dandiset when changing owner list #2000

Open
waxlamp opened this issue Aug 9, 2024 · 0 comments
Open

Lock dandiset when changing owner list #2000

waxlamp opened this issue Aug 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@waxlamp
Copy link
Member

waxlamp commented Aug 9, 2024

Originally posted by @mvandenburgh in #1886 (comment):

This problem existed before this PR, but I'll just mention that by the time this .save() is called this Dandiset object might be stale. I think we need to lock the dandiset object with select_for_update.

# All owners found
with transaction.atomic():
owners = user_owners + [acc.user for acc in socialaccount_owners]
removed_owners, added_owners = dandiset.set_owners(owners)
dandiset.save()

@waxlamp waxlamp added the bug Something isn't working label Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant