decompose_interval: 0 years should be 0 seconds
This commit is contained in:
parent
0f80fc74a0
commit
78cb985a4b
|
@ -19,6 +19,10 @@ def decompose_interval(attrname):
|
|||
|
||||
@property
|
||||
def scale(self):
|
||||
|
||||
if getattr(self, attrname) == timedelta(0):
|
||||
return timedelta(seconds=1)
|
||||
|
||||
for m in scales:
|
||||
if getattr(self, attrname) % m == timedelta(0):
|
||||
return m
|
||||
|
|
Loading…
Reference in New Issue