Fix - Allow for `Union[None, List[datetime.datetime]]` when printing user

tables for the weekly mail logs.
This commit is contained in:
Matt 2024-04-08 21:27:36 +10:00
parent a332be6a7b
commit 5778ec339a
1 changed files with 3 additions and 3 deletions

View File

@ -679,7 +679,7 @@ def print_user_table(users, data=None, sub_data=None, activity=None, latest=None
data_accum[col] += d[row]
try:
if None not in {latest, earliest}:
if None not in [latest, earliest]:
vert_pos = len(line)
e = earliest[row]
l = latest[row]
@ -732,7 +732,7 @@ def print_user_table(users, data=None, sub_data=None, activity=None, latest=None
else:
header += l.rjust(max(5, len(l) + 1, col_widths[col]))
if None not in {latest, earliest}:
if None not in [latest, earliest]:
header += " │ timespan "
lines.insert(0, header.rstrip())
@ -757,7 +757,7 @@ def print_user_table(users, data=None, sub_data=None, activity=None, latest=None
footer += temp.format(data_accum[row])
try:
if None not in {latest, earliest}:
if None not in [latest, earliest]:
max_l = max(latest)
min_e = min(earliest)
timespan = relativedelta(max_l, min_e)