|
@ -146,6 +146,11 @@ class DeadMansSwitchInstance(models.Model): |
|
|
def panic(self): |
|
|
def panic(self): |
|
|
"""override for custom handling""" |
|
|
"""override for custom handling""" |
|
|
self.ensure_one() |
|
|
self.ensure_one() |
|
|
|
|
|
last_post = fields.Datetime.from_string(self.message_last_post) |
|
|
|
|
|
if last_post >= datetime.utcnow() - 3 * timedelta( |
|
|
|
|
|
seconds=self.alive_max_delay): |
|
|
|
|
|
# don't nag too often |
|
|
|
|
|
return |
|
|
self.message_post( |
|
|
self.message_post( |
|
|
type='comment', subtype='mt_comment', |
|
|
type='comment', subtype='mt_comment', |
|
|
subject=_('Dead man\'s switch warning: %s') % |
|
|
subject=_('Dead man\'s switch warning: %s') % |
|
|