From 53a6cc1501bea67219f8ccb5becf2b9f09c98cf9 Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 8 Apr 2024 21:27:36 +1000 Subject: [PATCH] Fix - Allow for `Union[None, List[datetime.datetime]]` when printing user tables for the weekly mail logs. --- management/mail_log.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/management/mail_log.py b/management/mail_log.py index ee8d3700..cfd4ca61 100755 --- a/management/mail_log.py +++ b/management/mail_log.py @@ -690,7 +690,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] @@ -743,7 +743,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()) @@ -768,7 +768,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)