misc: add Lock.lock_identifier method (#65412)
This commit is contained in:
parent
4e0c3163e9
commit
e6d3cbe808
|
@ -625,6 +625,10 @@ class Lock(models.Model):
|
|||
def lock_email(cls, email, nowait=False):
|
||||
cls.lock('email:%s' % email, nowait=nowait)
|
||||
|
||||
@classmethod
|
||||
def lock_identifier(cls, identifier, nowait=False):
|
||||
cls.lock('identifier:%s' % identifier, nowait=nowait)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _('Lock')
|
||||
verbose_name_plural = _('Lock')
|
||||
|
|
Loading…
Reference in New Issue