From fd9649abf2877081d1398c5741bdd6cc5914fb90 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Wed, 7 Jan 2015 21:24:42 +0000 Subject: [PATCH] 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 --- ietf/person/fields.py | 2 +- ietf/secr/sreq/views.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ietf/person/fields.py b/ietf/person/fields.py index 11462bc41..6cce7169f 100644 --- a/ietf/person/fields.py +++ b/ietf/person/fields.py @@ -16,7 +16,7 @@ def tokeninput_id_name_json(objs): formatter = format_email if objs and isinstance(objs[0], Email) else format_person - return json.dumps([{ "id": o.pk, "name": formatter(o) } for o in objs]) + return json.dumps([{ "id": o.pk, "name": formatter(o) } for o in objs if o]) class AutocompletedPersonsField(forms.CharField): """Tokenizing autocompleted multi-select field for choosing diff --git a/ietf/secr/sreq/views.py b/ietf/secr/sreq/views.py index 927ebec4a..8c25f4f11 100644 --- a/ietf/secr/sreq/views.py +++ b/ietf/secr/sreq/views.py @@ -315,7 +315,8 @@ def add_essential_people(group,initial): if 'bethere' in initial: people.update(initial['bethere']) people.update(Person.objects.filter(role__group=group, role__name='chair')) - people.add(group.ad) + if group.ad: + people.add(group.ad) initial['bethere'] = list(people)