Opened 14 years ago
Last modified 14 years ago
#15056 closed
'NoneType' object is not callable (smart_unicode is None) — at Initial Version
Reported by: | kenseehart | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | 1.2 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Running locally in debug mode
When I add an object, I get this traceback:
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8000/admin/tc/client/add/
Django Version: 1.2 beta 1
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'tc']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py" in get_response
- response = callback(request, *callback_args, callback_kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/options.py" in wrapper
- return self.admin_site.admin_view(view)(*args, kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in _wrapped_view
- response = view_func(request, *args, kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func
- response = view_func(request, *args, kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py" in inner
- return view(request, *args, kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in _wrapper
- return decorator(bound_func)(*args, kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in _wrapped_view
- response = view_func(request, *args, kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in bound_func
- return func(self, *args2, kwargs2)
File "/usr/local/lib/python2.6/dist-packages/django/db/transaction.py" in _commit_on_success
- res = func(*args, kw)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/options.py" in add_view
- self.log_addition(request, new_object)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/options.py" in log_addition
- action_flag = ADDITION
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/models.py" in log_action
- e = self.model(None, None, user_id, content_type_id, smart_unicode(object_id), object_repr[:200], action_flag, change_message)
Exception Type: TypeError at /admin/tc/client/add/
Exception Value: 'NoneType' object is not callable
smart_unicode is None
This seems to be some kind of magic import related bug, since there doesn't seem to be any natural way for the symbol 'smart_unicode' to be assigned the value None.
A hack patch that fixes the problem follows (though it would be good to properly diagnose the problem)
14a15
from django.utils.encoding import smart_unicode