From 0b61e517d2605ce5538b496ea096d431a0d14088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 15 Sep 2017 17:03:31 +0200 Subject: [PATCH] Added missing attached_to.url assignment --- cloud/routes.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cloud/routes.py b/cloud/routes.py index f868ff7..a91e72d 100644 --- a/cloud/routes.py +++ b/cloud/routes.py @@ -80,14 +80,17 @@ def homepage(): except ResourceNotFound: # Remove this comment to_remove.append(idx) - else: - comment.attached_to.url = url_for_node(node=comment.attached_to) else: comment.attached_to = comment.parent for idx in reversed(to_remove): del latest_comments._items[idx] + for comment in latest_comments._items: + if not comment.attached_to: + continue + comment.attached_to.url = url_for_node(node=comment.attached_to) + main_project = Project.find(current_app.config['MAIN_PROJECT_ID'], api=api) main_project.picture_header = get_file(main_project.picture_header, api=api)