Skip to content

Commit 8ebfd5d

Browse files
committed
models: raise error on seconds==None
1 parent d2fd645 commit 8ebfd5d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mailpit/client/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ def millis_to_3_digit(isoformat: str) -> str:
235235
if not millis:
236236
seconds = _re.search(r":\d+(:\d+)", isoformat)
237237
_log.debug(f"seconds: {seconds}")
238+
if seconds is None:
239+
raise ValueError("seconds may not be None")
238240
return isoformat.replace(seconds.group(0), f"{seconds.group(0)}.000")
239241
_log.debug(f"millis: {millis.group(0)}, {_d.Decimal(millis.group(0)):.03f}")
240242
return isoformat.replace(

0 commit comments

Comments
 (0)