Skip to content

Commit fd9649a

Browse files
committed
Don't add the group's ad to the list of people who need to be at a meeting if the group doesn't have an ad. Protects the field formatter from occurances of None in passed in lists. Patch applied to production. Commit ready for merge.
- Legacy-Id: 8848
1 parent 413e926 commit fd9649a

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

ietf/person/fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def format_person(p):
1616

1717
formatter = format_email if objs and isinstance(objs[0], Email) else format_person
1818

19-
return json.dumps([{ "id": o.pk, "name": formatter(o) } for o in objs])
19+
return json.dumps([{ "id": o.pk, "name": formatter(o) } for o in objs if o])
2020

2121
class AutocompletedPersonsField(forms.CharField):
2222
"""Tokenizing autocompleted multi-select field for choosing

ietf/secr/sreq/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ def add_essential_people(group,initial):
315315
if 'bethere' in initial:
316316
people.update(initial['bethere'])
317317
people.update(Person.objects.filter(role__group=group, role__name='chair'))
318-
people.add(group.ad)
318+
if group.ad:
319+
people.add(group.ad)
319320
initial['bethere'] = list(people)
320321

321322

0 commit comments

Comments
 (0)