First time here? Check out the FAQ!

Revision history  [back]

Why would visitor be none when getting comments

I'm having a problem with a custom askbot setup that I'm finding rather hard to diagnose. When attempting to run two particular unit tests together, I'm getting the following error:

    /my/home/directory/workspace/my/project/directory/.ve/lib/python2.6/site-packages/askbot/middleware/pagesize.py TIME: 2011-09-06 11:40:17,935 MSG: pagesize.py:process_exception:43   File "/my/home/directory/workspace/my/project/directory/.ve/lib/python2.6/site-packages/django/core/handlers/base.py", line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/my/home/directory/workspace/my/project/directory/../rimawebsites/forum/views/readers.py", line 15, in question
    **kwargs)
  File "/my/home/directory/workspace/my/project/directory/../rimawebsites/forum/views/render.py", line 5, in render_jinja2_into_django_template
    response = jinja2_view(request, *args, **kwargs)
  File "/my/home/directory/workspace/my/project/directory/.ve/lib/python2.6/site-packages/django/utils/decorators.py", line 76, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/my/home/directory/workspace/my/project/directory/.ve/lib/python2.6/site-packages/askbot/views/readers.py", line 552, in question
    return render_into_skin('question.html', data, request)
  File "/my/home/directory/workspace/my/project/directory/.ve/lib/python2.6/site-packages/askbot/skins/loaders.py", line 145, in render_into_skin
    return HttpResponse(template.render(context), mimetype = mimetype)
  File "/my/home/directory/workspace/my/project/directory/.ve/lib/python2.6/site-packages/coffin/template/__init__.py", line 54, in render
    return super(Template, self).render(**context)
  File "/my/home/directory/workspace/my/project/directory/.ve/lib/python2.6/site-packages/jinja2/environment.py", line 894, in render
    return self.environment.handle_exception(exc_info, True)
  File "/my/home/directory/workspace/my/project/directory/forum/skins/rima_skin/templates/question.html", line 2, in top-level template code
    {% import "macros.html" as macros %}
  File "/my/home/directory/workspace/my/project/directory/forum/skins/rima_skin/templates/two_column_body.html", line 1, in top-level template code
    {% extends "base.html" %}
  File "/my/home/directory/workspace/my/project/directory/forum/skins/rima_skin/templates/base.html", line 5, in top-level template code
    {% block body %}
  File "/my/home/directory/workspace/my/project/directory/forum/skins/rima_skin/templates/two_column_body.html", line 6, in block "body"
    {% block content%}
  File "/my/home/directory/workspace/my/project/directory/forum/skins/rima_skin/templates/question.html", line 141, in block "content"
    macros.post_comments_widget(
  File "/my/home/directory/workspace/my/project/directory/forum/skins/rima_skin/templates/macros.html", line 498, in template
    {% spaceless %}
  File "/my/home/directory/workspace/my/project/directory/.ve/lib/python2.6/site-packages/coffin/template/defaulttags.py", line 369, in _strip_spaces
    return strip_spaces_between_tags(caller().strip())
  File "/my/home/directory/workspace/my/project/directory/forum/skins/rima_skin/templates/macros.html", line 511, in template
    {% set comments = post.get_comments()[:max_comments] %}
  File "/my/home/directory/workspace/my/project/directory/.ve/lib/python2.6/site-packages/askbot/models/content.py", line 56, in get_comments
    if visitor.is_anonymous():

/my/home/directory/workspace/my/project/directory/.ve/lib/python2.6/site-packages/askbot/middleware/pagesize.py TIME: 2011-09-06 11:40:17,935 MSG: pagesize.py:process_exception:44 <type 'exceptions.AttributeError'>
/my/home/directory/workspace/my/project/directory/.ve/lib/python2.6/site-packages/askbot/middleware/pagesize.py TIME: 2011-09-06 11:40:17,935 MSG: pagesize.py:process_exception:45 'NoneType' object has no attribute 'is_anonymous'
/my/home/directory/workspace/my/project/directory/.ve/lib/python2.6/site-packages/askbot/middleware/pagesize.py TIME: 2011-09-06 11:40:17,936 MSG: pagesize.py:process_exception:54 path: /en/forum/question/1/
method: GET
data: <QueryDict: {}>
host: testserver
user ID: 1

I'm using python 2.6, Django 1.2.3. The first test involves viewing the edit profile page. The second one involves displaying the page for a question.