Karaage-Cluster/karaage — Issue #46: adding software without group
Author: sorrison
Created: 2012-02-15 22:48:13+00:00
State: open

My reading of the code is that the gid is meant to be optional, but in practice it isn't.

Environment:

Request Method: POST
Request URL: http://localhost:8000/software/add/
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 "/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/software/views/admin.py" in add_package
110. package = form.save()
File "/home/brian/karaage/python/karaage/software/forms.py" in save
78. package = super(self.__class__, self).save()
File "/home/brian/karaage/python/karaage/software/forms.py" in save
48. package.save()
File "/usr/lib/pymodules/python2.6/django/db/models/base.py" in save
410. self.save_base(force_insert=force_insert, force_update=force_update)
File "/usr/lib/pymodules/python2.6/django/db/models/base.py" in save_base
483. values = [(f, f.get_db_prep_save(raw and getattr(self, f.attname) or f.pre_save(self, True))) for f in meta.local_fields if not isinstance(f, AutoField)]
File "/usr/lib/pymodules/python2.6/django/db/models/fields/__init__.py" in get_db_prep_save
192. return self.get_db_prep_value(value)
File "/usr/lib/pymodules/python2.6/django/db/models/fields/__init__.py" in get_db_prep_value
698. return int(value)

Exception Type: ValueError at /software/add/
Exception Value: invalid literal for int() with base 10: ''