- activity = self.activity.resolve(context)\r
-\r
- context = {\r
- 'active_at': activity.active_at,\r
- 'description': activity.type_as_string,\r
- 'type': activity.activity_type,\r
- }\r
-\r
- if activity.activity_type == const.TYPE_ACTIVITY_PRIZE:\r
- context['badge'] = True\r
- context['title'] = activity.content_object.badge.name\r
- context['url'] = activity.content_object.badge.get_absolute_url()\r
- context['badge_type'] = activity.content_object.badge.type\r
- else:\r
- context['title'] = activity.node.headline\r
- context['url'] = activity.node.get_absolute_url()\r
-\r
- if activity.activity_type in (const.TYPE_ACTIVITY_UPDATE_ANSWER, const.TYPE_ACTIVITY_UPDATE_QUESTION):\r
- context['revision'] = True\r
- context['summary'] = activity.content_object.summary or \\r
- _('Revision n. %(rev_number)d') % {'rev_number': activity.content_object.revision}\r
-\r
- return self.template.render(template.Context(context))\r
+ try:\r
+ activity = self.activity.resolve(context)\r
+\r
+ context = {\r
+ 'active_at': activity.active_at,\r
+ 'description': activity.type_as_string,\r
+ 'type': activity.activity_type,\r
+ }\r
+\r
+ if activity.activity_type == const.TYPE_ACTIVITY_PRIZE:\r
+ context['badge'] = True\r
+ context['title'] = activity.content_object.badge.name\r
+ context['url'] = activity.content_object.badge.get_absolute_url()\r
+ context['badge_type'] = activity.content_object.badge.type\r
+ else:\r
+ context['title'] = activity.node.headline\r
+ context['url'] = activity.node.get_absolute_url()\r
+\r
+ if activity.activity_type in (const.TYPE_ACTIVITY_UPDATE_ANSWER, const.TYPE_ACTIVITY_UPDATE_QUESTION):\r
+ context['revision'] = True\r
+ context['summary'] = activity.content_object.summary or \\r
+ _('Revision n. %(rev_number)d') % {'rev_number': activity.content_object.revision}\r
+\r
+ return self.template.render(template.Context(context))\r
+ except Exception, e:\r
+ return ''\r