Skip to content

Commit b04171b

Browse files
committed
Added guards against using attributes of None in a couple of places.
- Legacy-Id: 17772
1 parent 111d274 commit b04171b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ietf/meeting/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,15 +601,15 @@ def cubehelix(i, total, hue=1.2, start_angle=0.5):
601601

602602
session_parents = sorted(set(
603603
s.group.parent for s in sessions
604-
if s.group and s.group.parent and s.group.parent.type_id == 'area' or s.group.parent.acronym == 'irtf'
604+
if s.group and s.group.parent and (s.group.parent.type_id == 'area' or s.group.parent.acronym == 'irtf')
605605
), key=lambda p: p.acronym)
606606
for i, p in enumerate(session_parents):
607607
rgb_color = cubehelix(i, len(session_parents))
608608
p.scheduling_color = "#" + "".join( hex(int(round(x * 255)))[2:] for x in rgb_color)
609609

610610
# dig out historic AD names
611611
ad_names = {}
612-
session_groups = set(s.group for s in sessions if s.group and s.group.parent.type_id == 'area')
612+
session_groups = set(s.group for s in sessions if s.group and s.group.parent and s.group.parent.type_id == 'area')
613613
meeting_time = datetime.datetime.combine(meeting.date, datetime.time(0, 0, 0))
614614

615615
for group_id, history_time, name in Person.objects.filter(rolehistory__name='ad', rolehistory__group__group__in=session_groups, rolehistory__group__time__lte=meeting_time).values_list('rolehistory__group__group', 'rolehistory__group__time', 'name').order_by('rolehistory__group__time'):

0 commit comments

Comments
 (0)