First time here? Check out the FAQ!

Revision history  [back]

How to resolve AttributeError upgrading to 0.9.x?

Have attempted to upgrade from 0.7.53 to 0.9.x and get the following error. The migrations have succeeded after some number of reattempts, rollbacks, server restores. The step through 0.8.2 was successful:

AttributeError at /questions/
'unicode' object has no attribute 'get'
Request Method: GET
Request URL:    http://xxx.com/questions/
Django Version: 1.7.11
Exception Type: AttributeError
Exception Value:    
'unicode' object has no attribute 'get'
Exception Location: /usr/local/lib/python2.7/dist-packages/askbot/models/__init__.py in user_get_avatar_url, line 236
Python Executable:  /usr/bin/python
Python Version: 2.7.12
Python Path:    
['/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/opt',
 '/opt/xxx',
 '/usr/local/lib/python2.7/dist-packages/askbot/deps']
Server time:    Wed, 29 Nov 2017 10:04:40 +0000

Debug:

Environment:

Request Method: GET
Request URL: http://xxx.com/questions/

Django Version: 1.7.11
Python Version: 2.7.12
Installed Applications:
('longerusername',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'django.contrib.humanize',
 'django.contrib.sitemaps',
 'django.contrib.messages',
 'askbot',
 'askbot.deps.django_authopenid',
 'askbot.deps.livesettings',
 'keyedcache',
 'robots',
 'django_countries',
 'djcelery',
 'djkombu',
 'followit',
 'tinymce',
 'askbot.deps.group_messaging',
 'compressor',
 'captcha')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'askbot.middleware.anon_user.ConnectToSessionMessagesMiddleware',
 'askbot.middleware.forum_mode.ForumModeMiddleware',
 'askbot.middleware.cancel.CancelActionMiddleware',
 'django.middleware.transaction.TransactionMiddleware',
 'askbot.middleware.view_log.ViewLogMiddleware',
 'askbot.middleware.spaceless.SpacelessMiddleware',
 'askbot.middleware.csrf.CsrfViewMiddleware')


Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  111.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/askbot/views/readers.py" in questions
  287.         return render(request, 'main_page.html', template_data)
File "/usr/local/lib/python2.7/dist-packages/django/shortcuts.py" in render
  50.     return HttpResponse(loader.render_to_string(*args, **kwargs),
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in render_to_string
  178.         return t.render(context_instance)
File "/usr/local/lib/python2.7/dist-packages/coffin/template/__init__.py" in render
  55.         return super(Template, self).render(**context)
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py" in render
  989.         return self.environment.handle_exception(exc_info, True)
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py" in handle_exception
  754.         reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/askbot/templates/main_page.html" in top-level template code
  2. {% import "macros.html" as macros %}
File "/usr/local/lib/python2.7/dist-packages/askbot/templates/two_column_body.html" in top-level template code
  1. {% extends "base.html" %}
File "/usr/local/lib/python2.7/dist-packages/askbot/templates/base.html" in top-level template code
  45.             {% block body %}
File "/usr/local/lib/python2.7/dist-packages/askbot/templates/two_column_body.html" in block "body"
  9.     {% block sidebar%}
File "/usr/local/lib/python2.7/dist-packages/askbot/templates/main_page.html" in block "sidebar"
  27.     {% include "main_page/sidebar.html" %}
File "/usr/local/lib/python2.7/dist-packages/askbot/templates/main_page/sidebar.html" in top-level template code
  10.     {% include "widgets/contributors.html" %}
File "/usr/local/lib/python2.7/dist-packages/askbot/templates/widgets/contributors.html" in top-level template code
  4.     {% spaceless %}
File "/usr/local/lib/python2.7/dist-packages/coffin/template/defaulttags.py" in _strip_spaces
  369.         return strip_spaces_between_tags(caller().strip())
File "/usr/local/lib/python2.7/dist-packages/askbot/templates/widgets/contributors.html" in template
  6.         {{ macros.gravatar(person, 48) }}
File "/usr/local/lib/python2.7/dist-packages/askbot/templates/macros.html" in template
  577. {% spaceless %}
File "/usr/local/lib/python2.7/dist-packages/coffin/template/defaulttags.py" in _strip_spaces
  369.         return strip_spaces_between_tags(caller().strip())
File "/usr/local/lib/python2.7/dist-packages/askbot/templates/macros.html" in template
  582.     src="{{ user.get_avatar_url(size) }}"
File "/usr/local/lib/python2.7/dist-packages/askbot/models/__init__.py" in user_get_avatar_url
  236.     url = self.avatar_urls.get(size)

Exception Type: AttributeError at /questions/
Exception Value: 'unicode' object has no attribute 'get'