From 691bc86ddf45390030100e677ecc712bfbd513ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 7 Nov 2016 12:16:40 +0100 Subject: [PATCH] Fixed bug viewing unassigned task without modification rights. --- attract/tasks/routes.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/attract/tasks/routes.py b/attract/tasks/routes.py index 89b02c2..9145bf0 100644 --- a/attract/tasks/routes.py +++ b/attract/tasks/routes.py @@ -71,8 +71,13 @@ def view_task(project, attract_props, task_id): users = project.get_users(api=api) project.users = users['_items'] else: - task.properties.assigned_to.users = [pillar.web.subquery.get_user_info(uid) - for uid in task.properties.assigned_to.users] + try: + user_ids = task.properties.assigned_to.users + except AttributeError: + task.properties['assigned_to'] = {'users': []} + else: + task.properties.assigned_to.users = [pillar.web.subquery.get_user_info(uid) + for uid in user_ids] return render_template('attract/tasks/view_task_embed.html', task=task,