Skip to content

Lock dandiset when changing owner list #2000

Closed
@waxlamp

Description

@waxlamp

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()

Metadata

Metadata

Assignees

Labels

internalChanges only affect the internal APIreleasedThis issue/pull request has been released.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions