Karaage-Cluster/karaage — Issue #45: adding person to project if user has no account
Author: sorrison
Created: 2012-02-15 22:48:00+00:00
State: open

Go to project, try to add person that has no account, generates stack trace instead of clean error, because gidNumber is not defined, because user has no account.

Environment:

Request Method: POST
Request URL: http://localhost:8000/projects/pMcDo0001/
Django Version: 1.1.1
Python Version: 2.6.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.6/django/core/handlers/base.py" in get_response
92. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/pymodules/python2.6/django/contrib/auth/decorators.py" in __call__
78. return self.view_func(request, *args, **kwargs)
File "/home/brian/karaage/python/karaage/projects/views/admin.py" in project_detail
114. add_user_to_project(person, project)
File "/home/brian/karaage/python/karaage/projects/util.py" in add_user_to_project
29. create_account(person, project, mc)
File "/home/brian/karaage/python/karaage/datastores/__init__.py" in create_account
54. return ads.create_account(person, default_project)
File "/home/brian/karaage/python/karaage/datastores/ldap_datastore.py" in create_account
127. gidNumber=ldap_attrs.GENERATED_USER_ATTRS['gidNumber'](data),

Exception Type: KeyError at /projects/pMcDo0001/
Exception Value: 'gidNumber'