jsonindex query failed when returning content with no __parent__

Bug #1655485 reported by Paul Everitt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KARL4
Fix Released
Medium
Jim Fulton

Bug Description

Apparently KARL has a bunch of content with no __parent__. Catalog queries have been suppressing them, but the new jsonindex queries has a problem when no __parent__.
AttributeError: 'NoneType' object has no attribute '__parent__'

 - Expression: "${ri.url}"
 - Filename: /srv/osfkarl/production/91/eggs/osi-4.3.1-py2.7.egg/osi/views/templates/profile.pt
 - Location: (121:23)

 - Source: <a href="${ri.url}">${ri.title}</a></td>
                        ^^^^^^^^^
 - Arguments: profile: {...} (36)
               repeat: {...} (0)
               renderer_name: templates/profile.pt
               tags: <list - at 0x8d8f84ecL>
               preferred_communities: <list - at 0x8d8f884cL>
               head_data: <script type="text/javascript">\nwindow._karl_clien...
               actions: <list - at 0x8d8f8f0cL>
               renderer_info: <RendererHelper - at 0xb05f41acL>
               api: <TemplateAPI - at 0x8d8f8f6cL>
               communities: <list - at 0x8d8f84acL>
               recent_items: <list - at 0x8d8e7eccL>
               recent_url: https://karl.soros.org/profiles/jdiamant/recent_co...
               request: <Request - at 0x8d8f86ecL>
               context: <Profile jdiamant at 0x9f5f90acL>
               photo: <NoneType - at 0xb772d3ccL>
               my_communities: <NoneType - at 0xb772d3ccL>
               view: <function osi_show_profile_view at 0xb05c74c4L>
Exception when processing https://karl.soros.org/profiles/jdiamant
Referer: None

Traceback (most recent call last):
  File "/srv/osfkarl/production/91/eggs/pyramid-1.2.1-py2.7.egg/pyramid/tweens.py", line 17, in excview_tween
    response = handler(request)
  File "/srv/osfkarl/production/91/eggs/pyramid_tm-0.5-py2.7.egg/pyramid_tm/__init__.py", line 107, in tm_tween
    return response
  File "/srv/osfkarl/production/91/eggs/pyramid_tm-0.5-py2.7.egg/pyramid_tm/__init__.py", line 75, in __exit__
    return self._retry_or_raise(t, v, tb)
  File "/srv/osfkarl/production/91/eggs/pyramid_tm-0.5-py2.7.egg/pyramid_tm/__init__.py", line 60, in _retry_or_raise
    reraise(t, v, tb) # otherwise reraise the exception
  File "/srv/osfkarl/production/91/eggs/pyramid_tm-0.5-py2.7.egg/pyramid_tm/__init__.py", line 100, in tm_tween
    response = handler(request)
  File "/srv/osfkarl/production/91/eggs/pyramid-1.2.1-py2.7.egg/pyramid/router.py", line 153, in handle_request
    response = view_callable(context, request)
  File "/srv/osfkarl/production/91/eggs/pyramid-1.2.1-py2.7.egg/pyramid/config/views.py", line 186, in _secured_view
    return view(context, request)
  File "/srv/osfkarl/production/91/eggs/pyramid-1.2.1-py2.7.egg/pyramid/config/views.py", line 311, in rendered_view
    context)
  File "/srv/osfkarl/production/91/eggs/pyramid-1.2.1-py2.7.egg/pyramid/renderers.py", line 393, in render_view
    return self.render_to_response(response, system, request=request)
  File "/srv/osfkarl/production/91/eggs/pyramid-1.2.1-py2.7.egg/pyramid/renderers.py", line 422, in render_to_response
    result = self.render(value, system_values, request=request)
  File "/srv/osfkarl/production/91/eggs/pyramid-1.2.1-py2.7.egg/pyramid/renderers.py", line 418, in render
    result = renderer(value, system_values)
  File "/srv/osfkarl/production/91/eggs/pyramid-1.2.1-py2.7.egg/pyramid/chameleon_zpt.py", line 49, in __call__
    result = self.template(**system)
  File "/srv/osfkarl/production/91/eggs/Chameleon-2.8.2-py2.7.egg/chameleon/template.py", line 125, in __call__
    return self.render(**kwargs)
  File "/srv/osfkarl/production/91/eggs/Chameleon-2.8.2-py2.7.egg/chameleon/zpt/template.py", line 258, in render
    return super(PageTemplate, self).render(**vars)
  File "/srv/osfkarl/production/91/eggs/Chameleon-2.8.2-py2.7.egg/chameleon/template.py", line 191, in render
    raise_with_traceback(exc, tb)
  File "/srv/osfkarl/production/91/eggs/Chameleon-2.8.2-py2.7.egg/chameleon/template.py", line 172, in render
    self._render(stream, econtext, rcontext)
  File "profile_b32de0cd4345224115808ccea4789bf01de6660c.py", line 2642, in render
  File "/srv/osfkarl/production/91/eggs/Chameleon-2.8.2-py2.7.egg/chameleon/zpt/template.py", line 262, in include
    self._render(*args, **kwargs)
  File "generic_layout_a105469e5ed444043c827c8e38221fea783d1549.py", line 1587, in render
  File "profile_b32de0cd4345224115808ccea4789bf01de6660c.py", line 2354, in __fill_content
  File "/srv/osfkarl/production/91/eggs/Chameleon-2.8.2-py2.7.egg/chameleon/py26.py", line 8, in lookup_attr
    raise exc
AttributeError: 'NoneType' object has no attribute '__parent__'

 - Expression: "${ri.url}"
 - Filename: /srv/osfkarl/production/91/eggs/osi-4.3.1-py2.7.egg/osi/views/templates/profile.pt
 - Location: (121:23)

 - Source: <a href="${ri.url}">${ri.title}</a></td>
                        ^^^^^^^^^
 - Arguments: profile: {...} (36)
               repeat: {...} (0)
               renderer_name: templates/profile.pt
               tags: <list - at 0x8d8f84ecL>
               preferred_communities: <list - at 0x8d8f884cL>
               head_data: <script type="text/javascript">\nwindow._karl_clien...
               actions: <list - at 0x8d8f8f0cL>
               renderer_info: <RendererHelper - at 0xb05f41acL>
               api: <TemplateAPI - at 0x8d8f8f6cL>
               communities: <list - at 0x8d8f84acL>
               recent_items: <list - at 0x8d8e7eccL>
               recent_url: https://karl.soros.org/profiles/jdiamant/recent_co...
               request: <Request - at 0x8d8f86ecL>
               context: <Profile jdiamant at 0x9f5f90acL>
               photo: <NoneType - at 0xb772d3ccL>
               my_communities: <NoneType - at 0xb772d3ccL>
               view: <function osi_show_profile_view at 0xb05c74c4L>

Tags: jsonindex
Revision history for this message
Paul Everitt (paul-agendaless) wrote :
Changed in karl4:
status: New → Fix Committed
Changed in karl4:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.