What causes this error: AttributeError: 'RssLastestQuestionsFeed' object has no attribute 'request

asked 2012-11-27 14:36:16 -0600

mrB gravatar image

I updated my Askbot to the most recent Github release and I keep getting this error:

AttributeError: 'RssLastestQuestionsFeed' object has no attribute 'request'

Traceback (most recent call last):  

  File "/home/spirituality/lib/python2.7/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 "/home/spirituality/lib/python2.7/Django-1.3.1-py2.7.egg/django/contrib/syndication/views.py", line 219, in feed  
    return instance(request)  

  File "/home/spirituality/lib/python2.7/Django-1.3.1-py2.7.egg/django/contrib/syndication/views.py", line 37, in __call__  
    feedgen = self.get_feed(obj, request)  

  File "/home/spirituality/lib/python2.7/Django-1.3.1-py2.7.egg/django/contrib/syndication/views.py", line 137, in get_feed  
    for item in self.__get_dynamic_attr('items', obj):  

  File "/home/spirituality/lib/python2.7/Django-1.3.1-py2.7.egg/django/contrib/syndication/views.py", line 70, in __get_dynamic_attr  
    return attr(obj)  

  File "/home/spirituality/webapps/askbot/askbot-discussion/askbot/feed.py", line 151, in items  
    query = self.request.GET.get("q", None)  

AttributeError: 'RssLastestQuestionsFeed' object has no attribute 'request'

I put a breakpoint on my local machine, ran the tests and found this:

> /Users/Bryan/work/askbot-discussion/askbot/feed.py(152)items()  
    151         import ipdb; ipdb.set_trace()  
--> 152         query = self.request.GET.get("q", None)  
    153         tags = self.request.GET.getlist("tags")  

ipdb> self  
<askbot.feed.RssLastestQuestionsFeed object at 0x116f3e7d0>  
ipdb> self.request  
*** AttributeError: 'RssLastestQuestionsFeed' object has no attribute 'request'  
ipdb> import pprint  
ipdb> pprint.pprint(self.__dict__)  
{'description_template': u'feeds/rss_description.html',  
 'feed_url': u'/feeds/rss/',  
 'title_template': u'feeds/rss_title.html'}  
ipdb>

What's the work around for this?

edit retag flag offensive close merge delete

Comments

This could be due to a bug in the latest port to django 1.4. Which version of django are you using?

Evgeny gravatar imageEvgeny ( 2012-11-27 22:54:27 -0600 )edit

Django 1.3.1

mrB gravatar imagemrB ( 2012-11-28 08:16:47 -0600 )edit