Opened 14 years ago

Last modified 14 years ago

#14242 closed

UserChangeForm Causes KeyError in 1.2.2 and Trunk — at Initial Version

Reported by: adammckerlie@… Owned by: nobody
Component: Forms Version: 1.2
Severity: Keywords: UserChangeForm, KeyError, 1.2.2, trunk
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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

  1. response = callback(request, *callback_args, callback_kwargs)

File "/usr/lib/python2.5/site-packages/django/views/decorators/cache.py" in _wrapped_view_func

  1. response = view_func(request, *args, kwargs)

File "/home/webdev/web/virtualenvs/polaris/polaris/apps/gapsource/views.py" in users_add

  1. dictform = UserForm(instance = user)

File "/home/webdev/web/virtualenvs/polaris/polaris/apps/gapsource/forms.py" in init

  1. super(UserForm, self).init(*args, kwargs)

File "/usr/lib/python2.5/site-packages/django/contrib/auth/forms.py" in init

  1. self.fieldsuser_permissions.queryset = self.fieldsuser_permissions.queryset.select_related('content_type')

Exception Type: KeyError at /gapsource/manage/users/edit/40318/
Exception Value: 'user_permissions'

Change History (0)

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