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
This commit is contained in:
Robert Sparks 2015-01-07 21:24:42 +00:00
parent 413e926b2b
commit fd9649abf2
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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)