Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#14242 closed (fixed)

UserChangeForm Causes KeyError in 1.2.2 and Trunk

Reported by: adammckerlie@… Owned by: Luke Plant
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 (last modified by Karen Tracey)

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'

Change History (6)

comment:1 by anonymous, 14 years ago

Component: UncategorizedForms
Keywords: UserChangeForm KeyError 1.2.2 trunk added

comment:2 by adammckerlie@…, 14 years ago

Here's a link to the traceback since the Wiki edited it.

http://dpaste.com/241054/

comment:3 by Karen Tracey, 14 years ago

Description: modified (diff)

comment:4 by Luke Plant, 14 years ago

Owner: changed from nobody to Luke Plant
Status: newassigned

comment:5 by Luke Plant, 14 years ago

Resolution: fixed
Status: assignedclosed

(In [13702]) Fixed #14242 - UserChangeForm subclasses without 'user_permissions' field causes KeyError

This was a regression introduced by [13683]

Thanks to adammckerlie@… for report.

comment:6 by Luke Plant, 14 years ago

(In [13704]) [1.2.X] Fixed #14242 - UserChangeForm subclasses without 'user_permissions' field causes KeyError

This was a regression introduced by [13684]

Thanks to adammckerlie@… for report.

Backport of [13702] from trunk.

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