Browse Source

[FIX] don't choke if there's no message_last_post

pull/302/head
Holger Brunn 8 years ago
parent
commit
842660a38a
  1. 2
      dead_mans_switch_server/models/dead_mans_switch_instance.py

2
dead_mans_switch_server/models/dead_mans_switch_instance.py

@ -147,7 +147,7 @@ class DeadMansSwitchInstance(models.Model):
"""override for custom handling"""
self.ensure_one()
last_post = fields.Datetime.from_string(self.message_last_post)
if last_post >= datetime.utcnow() - 3 * timedelta(
if last_post and last_post >= datetime.utcnow() - 3 * timedelta(
seconds=self.alive_max_delay):
# don't nag too often
return

Loading…
Cancel
Save