Comment #3 on issue 1847 by kent3...@gmail.com: The diff-comments resource is unaccessible in REST API 2.0
http://code.google.com/p/reviewboard/issues/detail?id=1847

I still have a similar problem with RB 1.6.1 running on Windows. Below is the error info. The code I am using is essentially this: url = u'http://myreviewboard.net/api/review-requests/1140/reviews/1445/diff-comments/'
headers = { 'Accept' : 'application/json' }
auth = ('user', 'pass')
import requests # http://pypi.python.org/pypi/requests/0.5.1
resp = requests.get(url, headers=headers, auth=auth)
resp.status_code
==> 500


Traceback (most recent call last):

File "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\core\handlers\base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

File "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\views\decorators\cache.py", line 79, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)

File "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\views\decorators\vary.py", line 22, in inner_func
    response = func(*args, **kwargs)

File "C:\Python27\lib\site-packages\djblets-0.6.13-py2.7.egg\djblets\webapi\resources.py", line 338, in __call__
    result = view(request, api_format=api_format, *args, **kwargs)

File "C:\Python27\lib\site-packages\reviewboard-1.6.1-py2.7.egg\reviewboard\webapi\decorators.py", line 127, in _check
    return view_func(*args, **kwargs)

File "C:\Python27\lib\site-packages\djblets-0.6.13-py2.7.egg\djblets\util\decorators.py", line 75, in _call
    f = augmented_func(*args, **kwargs)

File "C:\Python27\lib\site-packages\reviewboard-1.6.1-py2.7.egg\reviewboard\webapi\decorators.py", line 127, in _check
    return view_func(*args, **kwargs)

File "C:\Python27\lib\site-packages\djblets-0.6.13-py2.7.egg\djblets\webapi\decorators.py", line 231, in _validate
    return view_func(*args, **new_kwargs)

File "C:\Python27\lib\site-packages\djblets-0.6.13-py2.7.egg\djblets\util\decorators.py", line 75, in _call
    f = augmented_func(*args, **kwargs)

File "C:\Python27\lib\site-packages\reviewboard-1.6.1-py2.7.egg\reviewboard\webapi\decorators.py", line 32, in _check
    return view_func(*args, **kwargs)

File "C:\Python27\lib\site-packages\djblets-0.6.13-py2.7.egg\djblets\webapi\decorators.py", line 231, in _validate
    return view_func(*args, **new_kwargs)

File "C:\Python27\lib\site-packages\reviewboard-1.6.1-py2.7.egg\reviewboard\webapi\resources.py", line 148, in get_list
    return self._get_list_impl(request, *args, **kwargs)

File "C:\Python27\lib\site-packages\reviewboard-1.6.1-py2.7.egg\reviewboard\webapi\resources.py", line 157, in _get_list_impl
    return super(WebAPIResource, self).get_list(request, *args, **kwargs)

File "C:\Python27\lib\site-packages\djblets-0.6.13-py2.7.egg\djblets\webapi\decorators.py", line 231, in _validate
    return view_func(*args, **new_kwargs)

File "C:\Python27\lib\site-packages\djblets-0.6.13-py2.7.egg\djblets\webapi\resources.py", line 566, in get_list
    *args, **kwargs).select_related(),

File "C:\Python27\lib\site-packages\reviewboard-1.6.1-py2.7.egg\reviewboard\webapi\resources.py", line 433, in get_queryset
    request, review_request_id, *args, **kwargs)

File "C:\Python27\lib\site-packages\reviewboard-1.6.1-py2.7.egg\reviewboard\webapi\resources.py", line 323, in get_queryset
    filediff__diffset__history__review_request=review_request)

File "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\db\models\manager.py", line 141, in filter
    return self.get_query_set().filter(*args, **kwargs)

File "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\db\models\query.py", line 550, in filter
    return self._filter_or_exclude(False, *args, **kwargs)

File "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\db\models\query.py", line 568, in _filter_or_exclude
    clone.query.add_q(Q(*args, **kwargs))

File "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\db\models\sql\query.py", line 1191, in add_q
    self.add_q(child, used_aliases, force_having=force_having)

File "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\db\models\sql\query.py", line 1194, in add_q
    can_reuse=used_aliases, force_having=force_having)

File "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\db\models\sql\query.py", line 1129, in add_filter
    connector)

File "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\db\models\sql\where.py", line 67, in add
    value = obj.prepare(lookup_type, value)

File "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\db\models\sql\where.py", line 316, in prepare
    return self.field.get_prep_lookup(lookup_type, value)

File "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\db\models\fields\related.py", line 136, in get_prep_lookup
    return self._pk_trace(value, 'get_prep_lookup', lookup_type)

File "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\db\models\fields\related.py", line 209, in _pk_trace
    v = getattr(field, prep_func)(lookup_type, v, **kwargs)

File "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\db\models\fields\__init__.py", line 292, in get_prep_lookup
    return self.get_prep_value(value)

File "C:\Python27\lib\site-packages\django-1.3.1-py2.7.egg\django\db\models\fields\__init__.py", line 479, in get_prep_value
    return int(value)

TypeError: int() argument must be a string or a number, not 'AnonymousUser'


<WSGIRequest
GET:<QueryDict: {}>,
POST:<QueryDict: {}>,
COOKIES:{},
META:{'COMSPEC': 'C:\\WINDOWS\\system32\\cmd.exe',
 'DOCUMENT_ROOT': 'C:/reviewboard/htdocs',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': 'application/json',
 'HTTP_ACCEPT_ENCODING': 'gzip',
 'HTTP_CONNECTION': 'close',
 'HTTP_HOST': 'reviewboard.caliperls.net',
 'HTTP_USER_AGENT': 'python-requests.org',
 'PATHEXT': '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH',
 'PATH_INFO': u'/api/review-requests/1140/reviews/1445/diff-comments/',
 'PATH_TRANSLATED': 
'C:\\reviewboard\\htdocs\\reviewboard.wsgi\\api\\review-requests\\1140\\reviews\\1445\\diff-comments\\',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '172.18.2.2',
 'REMOTE_PORT': '59982',
 'REQUEST_METHOD': 'GET',
 'REQUEST_URI': '/api/review-requests/1140/reviews/1445/diff-comments/',
 'SCRIPT_FILENAME': 'C:/reviewboard/htdocs/reviewboard.wsgi',
 'SCRIPT_NAME': u'',
 'SERVER_ADDR': '172.16.12.1',
 'SERVER_ADMIN': 'kent.john...@caliperls.com',
 'SERVER_NAME': 'reviewboard.caliperls.net',
 'SERVER_PORT': '80',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SIGNATURE': '',
 'SERVER_SOFTWARE': 'Apache/2.2.17 (Win32) mod_wsgi/3.3 Python/2.7.1',
 'SystemRoot': 'C:\\WINDOWS',
 'WINDIR': 'C:\\WINDOWS',
 'mod_wsgi.application_group': 'reviewboard.caliperls.net|',
 'mod_wsgi.callable_object': 'application',
 'mod_wsgi.handler_script': '',
 'mod_wsgi.input_chunked': '0',
 'mod_wsgi.process_group': '',
 'mod_wsgi.request_handler': 'wsgi-script',
 'mod_wsgi.script_reloading': '1',
 'mod_wsgi.version': (3, 3),
 'wsgi.errors': <mod_wsgi.Log object at 0x03179B60>,
'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x0314C1D0>,
 'wsgi.input': <mod_wsgi.Input object at 0x03179DE0>,
 'wsgi.multiprocess': False,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 1)}>


--
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To post to this group, send email to reviewboard-issues@googlegroups.com.
To unsubscribe from this group, send email to 
reviewboard-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/reviewboard-issues?hl=en.

Reply via email to