mirror of https://github.com/snachodog/mybuddy.git
Explicitly set Timer.duration to None on instance save when the instance is still running.
This has to be done because the Timer.from_db() method fills in duration against the current time when the instance is still active. This issue was introduced in fd960cd
.
This commit is contained in:
parent
f02f28b7f9
commit
03dc139b0e
|
@ -183,6 +183,8 @@ class Timer(models.Model):
|
|||
self.name = self.name or None
|
||||
if self.start and self.end:
|
||||
self.duration = self.end - self.start
|
||||
else:
|
||||
self.duration = None
|
||||
super(Timer, self).save(*args, **kwargs)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue