From 5a78f1c510a4a52f50ce143880037106592316b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20J=C3=A4ckel?= Date: Mon, 14 Nov 2016 13:16:34 +0100 Subject: [PATCH] Fixed motion projector if comment field is None. Fixed #2614. --- openslides/motions/access_permissions.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/openslides/motions/access_permissions.py b/openslides/motions/access_permissions.py index 6eef443a8..333bd4c06 100644 --- a/openslides/motions/access_permissions.py +++ b/openslides/motions/access_permissions.py @@ -47,13 +47,14 @@ class MotionAccessPermissions(BaseAccessPermissions): for the projector. Removes several fields. """ data = full_data.copy() - for i, field in enumerate(config['motions_comments']): - if not field.get('public'): - try: - data['comments'][i] = None - except IndexError: - # No data in range. Just do nothing. - pass + if data.get('comments') is not None: + for i, field in enumerate(config['motions_comments']): + if not field.get('public'): + try: + data['comments'][i] = None + except IndexError: + # No data in range. Just do nothing. + pass return data