Prevent global 404 on /attract when an activity can't be linked.

This happens when an activity is on a deleted item. This change implies
that "someone deleted X" activities aren't going to be shown.
This commit is contained in:
2016-11-10 11:33:43 +01:00
parent 3917c90a13
commit ca69b43839

View File

@@ -3,6 +3,7 @@ import logging
from flask import Blueprint, render_template, redirect, url_for
import flask_login
import werkzeug.exceptions as wz_exceptions
from pillar.web.utils import attach_project_pictures
import pillar.web.subquery
@@ -55,7 +56,7 @@ def index():
act.project = id_to_proj[act.project]
try:
act.link = current_attract.link_for_activity(act)
except ValueError:
except (ValueError, wz_exceptions.NotFound):
act.link = None
return render_template('attract/index.html',