Karaage-Cluster/karaage — Issue #51: Django ValueError assigning unknown usage
Author: sorrison
Created: 2012-02-15 22:48:59+00:00
State: open

This error happened when I tried to assign unknown usage by a
user to a particular project, but neglected to say what the
username was (I thought it would just re-use the one already
listed for it).

Subject: [Karaage] - Error (EXTERNAL IP): /accounts/usage/unknown/
Date: Tue, 08 Jun 2010 06:01:34 -0000
From: help@vlsci.unimelb.edu.au
To: aisaac@unimelb.edu.au, bpe@unimelb.edu.au, samuel@unimelb.edu.au

Traceback (most recent call last):

File "/usr/lib/pymodules/python2.5/django/core/handlers/base.py",
line 100, in get_response
response = callback(request, *callback_args, **callback_kwargs)

File "/usr/lib/pymodules/python2.5/karaage/usage/views.py", line 263,
in unknown_usage
person = Person.objects.get(pk=request.POST['user'])

File "/usr/lib/pymodules/python2.5/django/db/models/manager.py", line
132, in get
return self.get_query_set().get(*args, **kwargs)

File "/usr/lib/pymodules/python2.5/django/db/models/query.py", line
333, in get
clone = self.filter(*args, **kwargs)

File "/usr/lib/pymodules/python2.5/django/db/models/query.py", line
550, in filter
return self._filter_or_exclude(False, *args, **kwargs)

File "/usr/lib/pymodules/python2.5/django/db/models/query.py", line
568, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))

File "/usr/lib/pymodules/python2.5/django/db/models/sql/query.py",
line 1131, in add_q
can_reuse=used_aliases)

File "/usr/lib/pymodules/python2.5/django/db/models/sql/query.py",
line 1071, in add_filter
connector)

File "/usr/lib/pymodules/python2.5/django/db/models/sql/where.py",
line 66, in add
value = obj.prepare(lookup_type, value)

File "/usr/lib/pymodules/python2.5/django/db/models/sql/where.py",
line 299, in prepare
return self.field.get_prep_lookup(lookup_type, value)

File
"/usr/lib/pymodules/python2.5/django/db/models/fields/__init__.py", line
292, in get_prep_lookup
return self.get_prep_value(value)

File
"/usr/lib/pymodules/python2.5/django/db/models/fields/__init__.py", line
476, in get_prep_value
return int(value)

ValueError: invalid literal for int() with base 10: ''

,
POST:,
COOKIES:{'__utma':
'235321950.1952740615.1275890769.1275890769.1275890769.1',
'__utmz':
'235321950.1275890769.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)',
'sessionid': '5a9060174a61860ffc2e4eb4dab98399'},
META:{'AUTH_TYPE': None,
'CONTENT_LENGTH': '110',
'CONTENT_TYPE': 'application/x-www-form-urlencoded',
'GATEWAY_INTERFACE': 'CGI/1.1',
'HTTP_ACCEPT': 'text/html, image/jpeg;q=0.9, image/png;q=0.9,
text/*;q=0.9, image/*;q=0.9, */*;q=0.8',
'HTTP_ACCEPT_CHARSET': 'utf-8, utf-8;q=0.5, *;q=0.5',
'HTTP_ACCEPT_ENCODING': 'x-gzip, x-deflate, gzip, deflate',
'HTTP_ACCEPT_LANGUAGE': 'en-AU, en-US, en',
'HTTP_CACHE_CONTROL': 'no-cache',
'HTTP_CONNECTION': 'Keep-Alive',
'HTTP_CONTENT_LENGTH': '110',
'HTTP_CONTENT_TYPE': 'application/x-www-form-urlencoded',
'HTTP_COOKIE': 'sessionid=5a9060174a61860ffc2e4eb4dab98399;
__utmz=195587947.1263774510.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);
__utma=195587947.693075633.1263774510.1275616054.1275621774.101;
__utmz=235321950.1275890769.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);
__utma=235321950.1952740615.1275890769.1275890769.1275890769.1',
'HTTP_HOST': 'help.vlsci.unimelb.edu.au',
'HTTP_PRAGMA': 'no-cache',
'HTTP_REFERER':
'https://help.vlsci.unimelb.edu.au/accounts/usage/unknown/',
'HTTP_USER_AGENT': 'Mozilla/5.0 (compatible; Konqueror/4.4; Linux)
KHTML/4.4.4 (like Gecko) Kubuntu',
'PATH_INFO': u'/usage/unknown/',
'PATH_TRANSLATED': None,
'QUERY_STRING': None,
'REMOTE_ADDR': '128.250.103.247',
'REMOTE_HOST': None,
'REMOTE_IDENT': None,
'REMOTE_USER': None,
'REQUEST_METHOD': 'POST',
'SCRIPT_NAME': '/accounts',
'SERVER_NAME': 'help.vlsci.unimelb.edu.au',
'SERVER_PORT': 443,
'SERVER_PROTOCOL': 'HTTP/1.1',
'SERVER_SOFTWARE': 'mod_python'}>