Opened 14 years ago

Closed 14 years ago

#15056 closed (invalid)

'NoneType' object is not callable (smart_unicode is None)

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 (last modified by Karen Tracey)

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
  101.                     response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/options.py" in wrapper
  240.                 return self.admin_site.admin_view(view)(*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in _wrapped_view
  68.                     response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func
  69.         response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py" in inner
  194.             return view(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in _wrapper
  21.             return decorator(bound_func)(*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in _wrapped_view
  68.                     response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in bound_func
  17.                 return func(self, *args2, **kwargs2)
File "/usr/local/lib/python2.6/dist-packages/django/db/transaction.py" in _commit_on_success
  295.                     res = func(*args, **kw)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/options.py" in add_view
  801.                 self.log_addition(request, new_object)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/options.py" in log_addition
  428.             action_flag     = ADDITION
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/models.py" in log_action
  19.         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

Change History (2)

comment:1 by Karen Tracey, 14 years ago

Description: modified (diff)

Fixed formatting. Please use WikiFormatting and preview before posting. If this is recreatable on your machine, I suspect something is corrupt in your install. Un-installing and re-installing (I'd suggest a more recent level than 1.2 beta, though I don't recall that 1.2 beta ever had this particular error reported against it) may fix the problem. Plenty of people are able to add things via the admin without error...this is not a problem people have been reporting generally, so whatever is wrong is likely specific to your setup and most properly fixed by fixing that, not changing Django code to include an import were it should not be necessary.

comment:2 by Russell Keith-Magee, 14 years ago

Resolution: invalid
Status: newclosed

Closing invalid; this report doesn't contain enough detail to reproduce the problem, and as Karen suggests, it is suggestive of a corrupt install. Feel free to reopen if you can provide specific instructions for reproducing the problem.

Note: See TracTickets for help on using tickets.
Back to Top