2565: Playing with sort prevented augment_queryset from being called

doug.pa*******@setre***** (Google Code) (Is this you? Claim this profile.)
david
david
Feb. 2, 2014
What version are you running?
1.6.5

What's the URL of the page containing the problem?
http://MYSERVER/reviews/r/?sort=people

What steps will reproduce the problem?
1. Visit https://MYSERVER/reviews/r/?sort=people
2.
3.

What is the expected output? What do you see instead?
Expect to see All Review Requests. Instead see 500 due to 'ReviewRequest' object has no attribute 'publicreviewcount_count' or similar.

What operating system are you using? What browser?
Solaris. Chrome.

Please provide any additional information below.
I was playing with the URL trying to sort by People (Target People), which doesn't seem possible. It seems like this resulted in no sort being done, which in turn means augment_queryset isn't called on any columns, causing mass breakage which takes a while to figure out. Should augment_queryset be called whether or not sort optimization is being done?
david
#1 david
Can you include the traceback?
  • +NeedInfo
#2 doug.pa*******@setre***** (Google Code) (Is this you? Claim this profile.)
Traceback (most recent call last):

  File "/users/home/doug/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/users/home/doug/lib/python2.6/site-packages/ReviewBoard-1.6.5-py2.6.egg/reviewboard/accounts/decorators.py", line 19, in _check
    return login_required(view_func)(*args, **kwargs)

  File "/users/home/doug/lib/python2.6/site-packages/Djblets-0.6.16-py2.6.egg/djblets/auth/util.py", line 46, in _checklogin
    return view_func(request, *args, **kwargs)

  File "/users/home/doug/lib/python2.6/site-packages/ReviewBoard-1.6.5-py2.6.egg/reviewboard/reviews/views.py", line 515, in all_review_requests
    return datagrid.render_to_response(template_name)

  File "/users/home/doug/lib/python2.6/site-packages/Djblets-0.6.16-py2.6.egg/djblets/datagrid/grids.py", line 710, in render_to_response
    self.load_state()

  File "/users/home/doug/lib/python2.6/site-packages/Djblets-0.6.16-py2.6.egg/djblets/datagrid/grids.py", line 545, in load_state
    self.precompute_objects()

  File "/users/home/doug/lib/python2.6/site-packages/Djblets-0.6.16-py2.6.egg/djblets/datagrid/grids.py", line 647, in precompute_objects
    for obj in object_list if obj is not None

  File "/users/home/doug/lib/python2.6/site-packages/Djblets-0.6.16-py2.6.egg/djblets/datagrid/grids.py", line 215, in render_cell
    rendered_data = self.render_data(obj)

  File "/users/home/doug/lib/python2.6/site-packages/ReviewBoard-1.6.5-py2.6.egg/reviewboard/reviews/datagrids.py", line 374, in render_data
    return str(review_request.publicreviewcount_count)

AttributeError: 'ReviewRequest' object has no attribute 'publicreviewcount_count'
david
#3 david
  • -NeedInfo
    +New
david
#4 david
  • +Component-Dashboard
david
#5 david
  • -New
    +PendingReview
  • +david
david
#6 david
Fixed in djblets master (b0329f0). Thanks!
  • -PendingReview
    +Fixed