From e0ce1052c0031b24927599d7f707962a206c0ddb Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Sat, 24 Nov 2012 17:34:56 +0100 Subject: [PATCH] Catch AttributeError for 'person.sort_name' in assignment/models.py --- openslides/assignment/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openslides/assignment/models.py b/openslides/assignment/models.py index b70972234..c208592c4 100644 --- a/openslides/assignment/models.py +++ b/openslides/assignment/models.py @@ -160,7 +160,10 @@ class Assignment(models.Model, SlideMixin): participants = [] for candidate in candidates.all(): participants.append(candidate.person) - participants.sort(key=lambda person: person.sort_name) + try: + participants.sort(key=lambda person: person.sort_name) + except AttributeError: + pass return participants #return candidates.values_list('person', flat=True)