stefanfoulis/django-filer — Issue #159: invalid literal for int() with base 10 in admin
Author: beatum
Created: 2011-12-18 09:01:26+00:00
State: open

Error source code: http://dpaste.com/hold/674979/

Environment:
ubuntu 11.04 + vertenv + PIL V 1.1.7
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/filer/image/8/media/filer_public/2011/12/17/23_2.jpg/
Django Version: 1.3
Python Version: 2.7.1

Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.webdesign',
'django.contrib.admin',
'django.contrib.admindocs',
'core',
'main',
'south',
'filer', # v. 0.8.5
'easy_thumbnails' # v. 1.0 - alpha - 20]

Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')

Traceback:
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper
307. return self.admin_site.admin_view(view)(*args, **kwargs)
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
93. response = view_func(request, *args, **kwargs)
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
79. response = view_func(request, *args, **kwargs)
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
197. return view(request, *args, **kwargs)
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
28. return bound_func(*args, **kwargs)
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
93. response = view_func(request, *args, **kwargs)
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
24. return func(self, *args2, **kwargs2)
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/db/transaction.py" in inner
217. res = func(*args, **kwargs)
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in change_view
947. obj = self.get_object(request, unquote(object_id))
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in get_object
451. return queryset.get(pk=object_id)
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/db/models/query.py" in get
341. clone = self.filter(*args, **kwargs)
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/db/models/query.py" in filter
550. return self._filter_or_exclude(False, *args, **kwargs)
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/db/models/query.py" in _filter_or_exclude
568. clone.query.add_q(Q(*args, **kwargs))
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/db/models/sql/query.py" in add_q
1172. can_reuse=used_aliases, force_having=force_having)
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/db/models/sql/query.py" in add_filter
1107. connector)
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/db/models/sql/where.py" in add
67. value = obj.prepare(lookup_type, value)
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/db/models/sql/where.py" in prepare
316. return self.field.get_prep_lookup(lookup_type, value)
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/db/models/fields/related.py" in get_prep_lookup
136. return self._pk_trace(value, 'get_prep_lookup', lookup_type)
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/db/models/fields/related.py" in _pk_trace
209. v = getattr(field, prep_func)(lookup_type, v, **kwargs)
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py" in get_prep_lookup
292. return self.get_prep_value(value)
File "/home/user/vipython/eshkin/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py" in get_prep_value
479. return int(value)

Exception Type: ValueError at /admin/filer/image/8/media/filer_public/2011/12/17/23_2.jpg/
Exception Value: invalid literal for int() with base 10: '8/media/filer_public/2011/12/17/23_2.jpg'

P.S. In the admin panel does not show preview of downloaded images. What's the problem I can not understand, can someone faced with this situation, I ask you to help sort out the problem.