Wednesday, January 30, 2013

an elusive ValueError: 'str' object not callable -- lost.

Hey guys.

I recently started getting a ValueError complaining that an str is not callable -- in a very wierd place.

This happens to some calls to messages.info(request, 'somethingsomething'), in one of those cases __inside the django console__

Traceback:

Traceback:
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper
  366.                 return self.admin_site.admin_view(view)(*args, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  89.         response = view_func(request, *args, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
  196.             return view(request, *args, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
  25.             return bound_func(*args, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
  21.                 return func(self, *args2, **kwargs2)
File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/admin/options.py" in changelist_view
  1169.                 response = self.response_action(request, queryset=cl.get_query_set(request))
File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/admin/options.py" in response_action
  908.             response = func(self, request, queryset)
File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/admin/actions.py" in delete_selected
  49.                 "count": n, "items": model_ngettext(modeladmin.opts, n)
File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/admin/options.py" in message_user
  696.         messages.info(request, message)

Exception Type: TypeError at /admin/auth/user/
Exception Value: 'str' object is not callable

More information:

Environment:


Request Method: POST
Request URL: http://idpee.herokuapp.com/admin/auth/user/

Django Version: 1.4.2
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'registration',
 'idpee',
 'oauth2app',
 'social_auth',
 'uni_form',
 'south')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'social_auth.middleware.SocialAuthExceptionMiddleware',
 '<CUSTOM_MIDDLEWARE>')

The custom middleware is rather simple and non-intrusive, so _please_ don't just blow this off as "you screwed something up in your middleware". We're already looking at that, thanks.

Any other ideas what's wrong? Anyone bumped into this?

The same problem occured in part of the app I control, removing the call to messages.info solved it.

Anything at all? Thanks.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment