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

fix: Hide last modified field in agenda when unavailable #7722

Merged
merged 5 commits into from
Aug 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ietf/meeting/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,8 @@ def updated(self):
if self.schedule:
assignments_updated = SchedTimeSessAssignment.objects.filter(schedule__in=[self.schedule, self.schedule.base if self.schedule else None]).aggregate(Max('modified'))["modified__max"]
dts = [timeslots_updated, sessions_updated, assignments_updated]
if valid_only := [dt for dt in dts if dt is not None]:
return max(valid_only)
return None
valid_only = [dt for dt in dts if dt is not None]
return max(valid_only) if valid_only else None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider:

dts = set([timeslots_updated, sessions_updated, assignments_updated])
dts.discard(None)
return max(dts) if len(dts)>0 else None

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(this is a pretty small style/readability nit)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll merge this without the above suggestion - if you agree with it, please make another PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL discard. Thanks. I'll see if a PR is necessary.


@memoize
def previous_meeting(self):
Expand Down
Loading