Skip to content

Commit

Permalink
Prevent race condition when trying to save LockToken for object after…
Browse files Browse the repository at this point in the history
… deleting expired one
  • Loading branch information
Renaud Parent committed Nov 2, 2016
1 parent b9b567c commit c713ee9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lock_tokens/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def save(self, *args, **opts):
locked_object_content_type=self.locked_object_content_type)
if token.has_expired():
token.delete()
return super(LockToken, self).save(*args, **opts)
return self.save(*args, **opts)
raise AlreadyLockedError

class Meta:
Expand Down

0 comments on commit c713ee9

Please sign in to comment.