Only try to populate the liaison user/email list from the from_entity if it's set.

- Legacy-Id: 2904
This commit is contained in:
Henrik Levkowetz 2011-03-24 09:59:53 +00:00
parent 2ae5776024
commit 2b50bfdcef

View file

@ -77,8 +77,11 @@ def get_info(request):
'needs_approval': from_entity.needs_approval(person=person),
'post_only': from_entity.post_only(person=person, user=request.user)})
if is_secretariat(request.user):
full_list = [(i.pk, i.email()) for i in from_entity.full_user_list()]
full_list.sort(lambda x,y: cmp(x[1], y[1]))
if from_entity:
full_list = [(i.pk, i.email()) for i in from_entity.full_user_list()]
full_list.sort(lambda x,y: cmp(x[1], y[1]))
else:
full_list = []
full_list = [(person.pk, person.email())] + full_list
result.update({'full_list': full_list})
json_result = simplejson.dumps(result)