Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for Union[None, List[datetime.datetime]] values when printing user table in weekly mail logs #2378

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions management/mail_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]: # noqa PLR6201
vert_pos = len(line)
e = earliest[row]
l = latest[row]
Expand Down Expand Up @@ -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]: # noqa PLR6201
header += " │ timespan "

lines.insert(0, header.rstrip())
Expand All @@ -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]: # noqa PLR6201
max_l = max(latest)
min_e = min(earliest)
timespan = relativedelta(max_l, min_e)
Expand Down