ValueError: invalid literal for int() with base 10: '42596/img/admin/icon_calendar.gif'

58 views
Skip to first unread message

ANIL KARADAĞ

unread,
Sep 1, 2009, 5:35:06 AM9/1/09
to django...@googlegroups.com
hello everbody,

i have en error for a week. i did not resolve and i did not find it's solution.

Sometimes system is sent an error:

File "/usr/lib/python2.5/site-
packages/django/db/models/fields/__init__.py", line 353, in get_db_prep_value
   return int(value)

ValueError: invalid literal for int() with base 10: '42596/img/admin/icon_calendar.gif'

42596 is a product id and

 'HTTP_REFERER': 'http://example.com./admin/product/product/42596/',
 'SCRIPT_URI': 'http://example.com/admin/product/product/42596/img/admin/icon_calendar.gif/',

icon_calender.gif is under admin_media and trust url is http://example.com/admin/media/img/admin/icon_calendar.gif/'

anyone know why system is not used to trust url?

--
Anıl KARADAĞ
Cihan Bilişim A.Ş. - Yazılım Geliştirme Uzmanı
GYTE- Bilgisayar Müh. Yüksek Lisans öğrencisi
http://anilkaradag.info/blog

Daniel Roseman

unread,
Sep 1, 2009, 7:12:25 AM9/1/09
to Django users
On Sep 1, 10:35 am, ANIL KARADAĞ <anil.kara...@gmail.com> wrote:
> hello everbody,
>
> i have en error for a week. i did not resolve and i did not find it's
> solution.
>
> Sometimes system is sent an error:
>
> File "/usr/lib/python2.5/site-packages/django/db/models/fields/__init__.py",
> line 353, in get_db_prep_value
>    return int(value)
>
> ValueError: invalid literal for int() with base 10:
> '42596/img/admin/icon_calendar.gif'
>
> 42596 is a product id and
>
>  'HTTP_REFERER':
> 'http://example.com./admin/product/product/42596/<http://www.emall.com.tr/admin/product/product/42596/>
> ',
>  'SCRIPT_URI': 'http://example.com/admin/product/product/42596/img/admin/icon_calenda...<http://www.emall.com.tr/admin/product/product/42596/img/admin/icon_ca...>
> ',
>
> icon_calender.gif is under admin_media and trust url ishttp://example.com/admin/media/img/admin/icon_calendar.gif/<http://www.emall.com.tr/admin/product/product/42596/img/admin/icon_ca...>
> '
>
> anyone know why system is not used to trust url?
>
> --
> Anıl KARADAĞ
> Cihan Bilişim A.Ş. - Yazılım Geliştirme Uzmanı
> GYTE- Bilgisayar Müh. Yüksek Lisans öğrencisihttp://anilkaradag.info/blog

I have seen this, and have attempted to track it down. It seems to be
caused by some Javascript. Can you tell me if you are using TinyMCE on
that page? And which browser are you using?
--
DR.

ANIL KARADAĞ

unread,
Sep 1, 2009, 7:17:18 AM9/1/09
to django...@googlegroups.com


2009/9/1 Daniel Roseman <dan...@roseman.org.uk>

yes, we use tinymce and i use firefox 3.5 candidate 3

thank you

 
--
DR.




--
Anıl KARADAĞ
Cihan Information S.C. - Software Development Engineer
GYTE- Computer Engineer. - Master student
http://anilkaradag.info/blog

Daniel Roseman

unread,
Sep 1, 2009, 8:11:22 AM9/1/09
to Django users
Thanks, that confirms my suspicions - that's exactly the setup I am
seeing the problem with. I believe there is some sort of conflict
between Firefox 3.5 and the TinyMCE javascript.

What seems to be happening is that TinyMCE injects various scripts
into the DOM. For some reason, in Firefox 3.5 this causes
document.getElementsByTagName('script') to no longer return the full
list of scripts in the DOM. Django's DateTimeShortcuts.js script uses
this list to work out its own source path (which it uses to find the
path to the admin icons), but now can no longer find itself in that
list, so fails.

This is really a bug either in Firefox or in TinyMCE, but could
probably be averted if Django had a better way for js files to get the
value of ADMIN_MEDIA_PREFIX. Not sure if this has been addressed in
the recent Google Summer of Code project to rewrite the admin
javascript.
--
DR.

ANIL KARADAĞ

unread,
Sep 1, 2009, 11:08:43 AM9/1/09
to django...@googlegroups.com


hi Daniel, i think your opinion is right. i looked some error logs(relevent to subject), their client agent is:

'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2',

Now, i did definition of tinymce to comment line. i am continue searching

thank you very much

regards,
 
--
DR.

Reply all
Reply to author
Forward
0 new messages