When using a the UserChangeForm
in 1.2.2 or Trunk it causes a KeyError
. The same code works fine in 1.2.1 and below.
Here's the code that I'm using http://dpaste.com/241056/
Traceback
Environment:
Request Method: GET
Request URL: http://polarisdev.gap.ca/polaris_django/gapsource/manage/users/edit/40318/
Django Version: 1.2.2
Python Version: 2.5.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'djangobb_forum',
'djapian',
'messages',
'directory',
'users',
'contracts',
'news',
'polls',
'gapsource',
'moderation']
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',
'django_authopenid.middleware.OpenIDMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
'django.middleware.transaction.TransactionMiddleware',
'djangobb_forum.middleware.LastLoginMiddleware',
'djangobb_forum.middleware.UsersOnline',
'django.middleware.cache.UpdateCacheMiddleware',
'users.middleware.LoginFromPHP')
Traceback:
File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py" in get_response
100. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.5/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
69. response = view_func(request, *args, **kwargs)
File "/home/webdev/web/virtualenvs/polaris/polaris/apps/gapsource/views.py" in users_add
269. dict['form'] = UserForm(instance = user)
File "/home/webdev/web/virtualenvs/polaris/polaris/apps/gapsource/forms.py" in __init__
44. super(UserForm, self).__init__(*args, **kwargs)
File "/usr/lib/python2.5/site-packages/django/contrib/auth/forms.py" in __init__
57. self.fields['user_permissions'].queryset = self.fields['user_permissions'].queryset.select_related('content_type')
Exception Type: KeyError at /gapsource/manage/users/edit/40318/
Exception Value: 'user_permissions'
Here's a link to the traceback since the Wiki edited it.
http://dpaste.com/241054/