diff options
author | Jessica Tallon <jessica@megworld.co.uk> | 2014-11-20 09:46:37 +0000 |
---|---|---|
committer | Jessica Tallon <jessica@megworld.co.uk> | 2014-11-20 09:46:37 +0000 |
commit | dd733916633b5bc2588cbe621087551144e70a63 (patch) | |
tree | 345011174372b0dbfdbd94f069d4e55c4c7150bc | |
parent | 45e687fcf8873a687a890f45f85bc75fb09502c5 (diff) | |
download | mediagoblin-dd733916633b5bc2588cbe621087551144e70a63.tar.lz mediagoblin-dd733916633b5bc2588cbe621087551144e70a63.tar.xz mediagoblin-dd733916633b5bc2588cbe621087551144e70a63.zip |
Fix #1021 - Skip broken activities which caused feed/inbox to 500
-rw-r--r-- | mediagoblin/federation/views.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mediagoblin/federation/views.py b/mediagoblin/federation/views.py index 4dad82d6..715cb8cd 100644 --- a/mediagoblin/federation/views.py +++ b/mediagoblin/federation/views.py @@ -357,7 +357,14 @@ def feed_endpoint(request): } for activity in Activity.query.filter_by(actor=request.user.id): - feed["items"].append(activity.serialize(request)) + try: + feed["items"].append(activity.serialize(request)) + except AttributeError: + # This occurs because of how we hard-deletion and the object + # no longer existing anymore. We want to keep the Activity + # in case someone wishes to look it up but we shouldn't display + # it in the feed. + pass feed["totalItems"] = len(feed["items"]) return json_response(feed) |