Karaage-Cluster/karaage — Issue #41: KeyError when saving record
Author: sorrison
Created: 2012-02-15 22:47:19+00:00
State: open

When I try to update my record and click save, I get this error:

Environment:

Request Method: POST
Request URL: https://help.vlsci.unimelb.edu.au/accounts/users/brian/edit/
Django Version: 1.1.1
Python Version: 2.5.5
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.humanize',
'django.contrib.flatpages',
'south',
'andsome.layout',
'andsome',
'django_surveys',
'karaage',
'karaage.people',
'karaage.machines',
'karaage.institutes',
'karaage.projects',
'karaage.usage',
'karaage.requests',
'karaage.cache',
'karaage.software',
'karaage.pbsmoab',
'karaage.projectreports',
'karaage.emails',
'placard.lgroups',
'placard.lusers',
'django_xmlrpc',
'django_pbs.servers',
'django_pbs.jobs',
'django.contrib.comments']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
'django.middleware.doc.XViewMiddleware',
'andsome.middleware.threadlocals.ThreadLocals')

Traceback:
File "/usr/lib/pymodules/python2.5/django/core/handlers/base.py" in get_response
92. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/pymodules/python2.5/django/contrib/auth/decorators.py" in __call__
78. return self.view_func(request, *args, **kwargs)
File "/usr/lib/pymodules/python2.5/karaage/people/views/admin.py" in add_edit_user
53. person = form.save(person)
File "/usr/lib/pymodules/python2.5/karaage/people/forms.py" in save
152. user.save()
File "/usr/lib/pymodules/python2.5/karaage/people/models.py" in save
131. update_user(self)
File "/usr/lib/pymodules/python2.5/karaage/datastores/__init__.py" in update_user
34. pds.update_user(person)
File "/usr/lib/pymodules/python2.5/karaage/datastores/ldap_datastore.py" in update_user
56. super(PersonalDataStore, self).update_user(person)
File "/usr/lib/pymodules/python2.5/karaage/datastores/base.py" in update_user
112. update_account(ua)
File "/usr/lib/pymodules/python2.5/karaage/datastores/__init__.py" in update_account
65. ads.update_account(ua)
File "/usr/lib/pymodules/python2.5/karaage/datastores/ldap_datastore.py" in update_account
160. gecos=ldap_attrs.GENERATED_USER_ATTRS['gecos'](data),
File "/usr/lib/pymodules/python2.5/kgadmin/conf/ldap_attrs.py" in
56. 'gecos': lambda x: 'posixAccount' in x['objectClass'] and '%s %s (%s)' % (str(x['givenName']), str(x['sn']), str(x['o'])) or '',

Exception Type: KeyError at /users/brian/edit/
Exception Value: 'o'