Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

AttributeError: 'NoneType' object has no attribute 'get_absolute_url'

Hello again!

Next error shows every time when I try to view my Inbox (http://localhost/users/1/support/?sort=inbox&section=forum)

Traceback (most recent call last):

 File "/var/src/askbot-devel/askbot_env/lib/python2.6/site-packages/django/core/handlers/base.py", line 111, in get_response
   response = callback(request, *callback_args, **callback_kwargs)

 File "/var/src/askbot-devel/askbot/views/users.py", line 824, in user
   return user_view_func(request, profile_owner, context)

 File "/var/src/askbot-devel/askbot/views/users.py", line 55, in wrapped_func
   return f(request, profile_owner, context)

 File "/var/src/askbot-devel/askbot/views/users.py", line 602, in user_responses
   'response_url': memo.activity.get_absolute_url(),

 File "/var/src/askbot-devel/askbot_env/lib/python2.6/site-packages/django/utils/functional.py", line 55, in _curried
   return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs))

 File "/var/src/askbot-devel/askbot_env/lib/python2.6/site-packages/django/db/models/base.py", line 887, in get_absolute_url
   return settings.ABSOLUTE_URL_OVERRIDES.get('%s.%s' % (opts.app_label, opts.module_name), func)(self, *args, **kwargs)

 File "/var/src/askbot-devel/askbot/models/user.py", line 209, in get_absolute_url
   return self.content_object.get_absolute_url()

AttributeError: 'NoneType' object has no attribute 'get_absolute_url'


<WSGIRequest
GET:<QueryDict: {u'sort': [u'inbox'], u'section': [u'forum']}>,
POST:<QueryDict: {}>,
COOKIES:{'askbot_visitor': 'False',
 'help.sunline.ua_csrf': '62dd351bd315bb8e3bc556353e995e62',
 'help_csrf': '70f00bfa211d743a9b34d112c214d483',
 'sessionid': '68c54d825d903f9aa423b25079b18b18'},
META:{'DOCUMENT_ROOT': '/var/www/localhost',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru,en-US;q=0.9,en;q=0.9,en-gb;q=0.9,bg-BG;q=0.9,bg;q=0.8,uk-UA;q=0.8,uk;q=0.8,nl-NL;q=0.7,nl;q=0.7,de-DE;q=0.7,de;q=0.7,fr-FR;q=0.6,fr;q=0.6,es-ES;q=0.6,es;q=0.5,ar-AE;q=0.5,ar;q=0.5,zh-CN;q=0.5,zh;q=0.4,th-TH;q=0.4,th;q=0.4,ru-RU-lite;q=0.3,ja-JP;q=0.3,ja;q=0.3,pt-PT;q=0.3,pt;q=0.2,en-EN;q=0.2,eo-EO;q=0.2,eo;q=0.1,pt-BR;q=0.1,ru-x-mtfrom-et;q=0.1,vi-VN;q=0.1,vi;q=0.0',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_COOKIE': 'localhost_csrf=62dd351bd315bb8e3bc556353e995e62; sessionid=68c54d825d903f9aa423b25079b18b18; help_csrf=70f00bfa211d743a9b34d112c214d483; askbot_visitor=False',
 'HTTP_HOST': 'localhost',
 'HTTP_REFERER': 'http://localhost/questions/',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/15.0 Firefox/15.0a1',
 'PATH_INFO': u'/users/1/support/',
 'PATH_TRANSLATED': '/var/www/localhost/django.wsgi/users/1/support/',
 'QUERY_STRING': 'sort=inbox&section=forum',
 'REMOTE_ADDR': '10.10.6.166',
 'REMOTE_PORT': '59932',
 'REQUEST_METHOD': 'GET',
 'REQUEST_URI': '/users/1/support/?sort=inbox&section=forum',
 'SCRIPT_FILENAME': '/var/www/localhost/django.wsgi',
 'SCRIPT_NAME': u'',
 'SERVER_ADDR': '10.100.100.1',
 'SERVER_ADMIN': 'support@slocalhost',
 'SERVER_NAME': 'localhost',
 'SERVER_PORT': '80',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SIGNATURE': '<address>Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze8 with Suhosin-Patch mod_wsgi/3.3 Python/2.6.6 mod_perl/2.0.4 Perl/v5.10.1 Server at localhost Port 80</address>\n',
 'SERVER_SOFTWARE': 'Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze8 with Suhosin-Patch mod_wsgi/3.3 Python/2.6.6 mod_perl/2.0.4 Perl/v5.10.1',
 'mod_wsgi.application_group': 'localhost|',
 'mod_wsgi.callable_object': 'application',
 'mod_wsgi.handler_script': '',
 'mod_wsgi.input_chunked': '0',
 'mod_wsgi.listener_host': '',
 'mod_wsgi.listener_port': '80',
 'mod_wsgi.process_group': 'askbot2',
 'mod_wsgi.request_handler': 'wsgi-script',
 'mod_wsgi.script_reloading': '1',
 'mod_wsgi.version': (3, 3),
 'wsgi.errors': <mod_wsgi.Log object at 0x7f7184516370>,
 'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7f7183f163f0>,
 'wsgi.input': <mod_wsgi.Input object at 0x7f71841d3070>,

AttributeError: 'NoneType' object has no attribute 'get_absolute_url'

Hello again!

Next error shows every time when I try to view my Inbox (http://localhost/users/1/support/?sort=inbox&section=forum)

Traceback (most recent call last):

 File "/var/src/askbot-devel/askbot_env/lib/python2.6/site-packages/django/core/handlers/base.py", line 111, in get_response
   response = callback(request, *callback_args, **callback_kwargs)

 File "/var/src/askbot-devel/askbot/views/users.py", line 824, in user
   return user_view_func(request, profile_owner, context)

 File "/var/src/askbot-devel/askbot/views/users.py", line 55, in wrapped_func
   return f(request, profile_owner, context)

 File "/var/src/askbot-devel/askbot/views/users.py", line 602, in user_responses
   'response_url': memo.activity.get_absolute_url(),

 File "/var/src/askbot-devel/askbot_env/lib/python2.6/site-packages/django/utils/functional.py", line 55, in _curried
   return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs))

 File "/var/src/askbot-devel/askbot_env/lib/python2.6/site-packages/django/db/models/base.py", line 887, in get_absolute_url
   return settings.ABSOLUTE_URL_OVERRIDES.get('%s.%s' % (opts.app_label, opts.module_name), func)(self, *args, **kwargs)

 File "/var/src/askbot-devel/askbot/models/user.py", line 209, in get_absolute_url
   return self.content_object.get_absolute_url()

AttributeError: 'NoneType' object has no attribute 'get_absolute_url'


<WSGIRequest
GET:<QueryDict: {u'sort': [u'inbox'], u'section': [u'forum']}>,
POST:<QueryDict: {}>,
COOKIES:{'askbot_visitor': 'False',
 'help.sunline.ua_csrf': '62dd351bd315bb8e3bc556353e995e62',
 'help_csrf': '70f00bfa211d743a9b34d112c214d483',
 'sessionid': '68c54d825d903f9aa423b25079b18b18'},
META:{'DOCUMENT_ROOT': '/var/www/localhost',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru,en-US;q=0.9,en;q=0.9,en-gb;q=0.9,bg-BG;q=0.9,bg;q=0.8,uk-UA;q=0.8,uk;q=0.8,nl-NL;q=0.7,nl;q=0.7,de-DE;q=0.7,de;q=0.7,fr-FR;q=0.6,fr;q=0.6,es-ES;q=0.6,es;q=0.5,ar-AE;q=0.5,ar;q=0.5,zh-CN;q=0.5,zh;q=0.4,th-TH;q=0.4,th;q=0.4,ru-RU-lite;q=0.3,ja-JP;q=0.3,ja;q=0.3,pt-PT;q=0.3,pt;q=0.2,en-EN;q=0.2,eo-EO;q=0.2,eo;q=0.1,pt-BR;q=0.1,ru-x-mtfrom-et;q=0.1,vi-VN;q=0.1,vi;q=0.0',
 'HTTP_CONNECTION': 'keep-alive',
 'HTTP_COOKIE': 'localhost_csrf=62dd351bd315bb8e3bc556353e995e62; sessionid=68c54d825d903f9aa423b25079b18b18; help_csrf=70f00bfa211d743a9b34d112c214d483; askbot_visitor=False',
 'HTTP_HOST': 'localhost',
 'HTTP_REFERER': 'http://localhost/questions/',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/15.0 Firefox/15.0a1',
 'PATH_INFO': u'/users/1/support/',
 'PATH_TRANSLATED': '/var/www/localhost/django.wsgi/users/1/support/',
 'QUERY_STRING': 'sort=inbox&section=forum',
 'REMOTE_ADDR': '10.10.6.166',
 'REMOTE_PORT': '59932',
 'REQUEST_METHOD': 'GET',
 'REQUEST_URI': '/users/1/support/?sort=inbox&section=forum',
 'SCRIPT_FILENAME': '/var/www/localhost/django.wsgi',
 'SCRIPT_NAME': u'',
 'SERVER_ADDR': '10.100.100.1',
 'SERVER_ADMIN': 'support@slocalhost',
 'SERVER_NAME': 'localhost',
 'SERVER_PORT': '80',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SIGNATURE': '<address>Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze8 with Suhosin-Patch mod_wsgi/3.3 Python/2.6.6 mod_perl/2.0.4 Perl/v5.10.1 Server at localhost Port 80</address>\n',
 'SERVER_SOFTWARE': 'Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze8 with Suhosin-Patch mod_wsgi/3.3 Python/2.6.6 mod_perl/2.0.4 Perl/v5.10.1',
 'mod_wsgi.application_group': 'localhost|',
 'mod_wsgi.callable_object': 'application',
 'mod_wsgi.handler_script': '',
 'mod_wsgi.input_chunked': '0',
 'mod_wsgi.listener_host': '',
 'mod_wsgi.listener_port': '80',
 'mod_wsgi.process_group': 'askbot2',
 'mod_wsgi.request_handler': 'wsgi-script',
 'mod_wsgi.script_reloading': '1',
 'mod_wsgi.version': (3, 3),
 'wsgi.errors': <mod_wsgi.Log object at 0x7f7184516370>,
 'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7f7183f163f0>,
 'wsgi.input': <mod_wsgi.Input object at 0x7f71841d3070>,


SELECT id,activity_type,content_type_id FROM activity WHERE user_id=10 GROUP BY activity_type;
+-----+---------------+-----------------+
| id  | activity_type | content_type_id |
+-----+---------------+-----------------+
| 542 |             1 |              25 |
| 348 |             2 |              25 |
| 568 |             4 |              25 |
| 544 |             5 |              25 |
| 805 |             6 |              25 |
| 545 |             7 |              27 |
| 543 |            15 |              25 |
+-----+---------------+-----------------+