Skip to content

Commit 30aa2b2

Browse files
committed
Don't crash if trying to get an update date for a meeting with missing timeslots or sessions.
- Legacy-Id: 6784
1 parent 7d7d084 commit 30aa2b2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

ietf/meeting/proxy.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,9 @@ def from_object(self, base):
116116
def updated(self):
117117
from django.db.models import Max
118118
import pytz
119-
ts = max(self.timeslot_set.aggregate(Max('modified'))["modified__max"],
120-
self.session_set.aggregate(Max('modified'))["modified__max"])
119+
now = datetime.datetime.now()
120+
ts = max(self.timeslot_set.aggregate(Max('modified'))["modified__max"] or now,
121+
self.session_set.aggregate(Max('modified'))["modified__max"] or now)
121122
tz = pytz.timezone(settings.PRODUCTION_TIMEZONE)
122123
ts = tz.localize(ts)
123124
return ts

0 commit comments

Comments
 (0)