google-code-export / django-page-cms

Automatically exported from code.google.com/p/django-page-cms
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

PAGE_LINK delete page : out of bound error #165

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to delete a page
2.
3.

What is the expected output? What do you see instead?
Some kind of 'out of bound error' displayed

What version of the product are you using? On what operating system?
version : r683
OS : Windows xp
Browser : Firefox 3.5.3

Please provide any additional information below.
Problem caused by a test in model.py : 
"if obj_pagelink_ids[0] !='':"

It was fixed by remplacing it by:
"if len(obj_pagelink_ids) > 0:"

Original issue reported on code.google.com by nea...@gmail.com on 15 Sep 2009 at 8:51

GoogleCodeExporter commented 9 years ago
I let you fix this small one :-)

Original comment by batiste....@gmail.com on 16 Sep 2009 at 8:13

GoogleCodeExporter commented 9 years ago
Witch version of Django and Python are you using?

I make the test like this because: obj_pagelink_ids is always a list, I make
obj_pagelink_ids.split(',') before the test.

tests:
>>> value = '6,17,22'
>>> type(value)
<type 'str'>
>>> value.split(',')
['6', '17', '22']
>>> type(value.split(','))
<type 'list'>
---------------
>>> value = '6'
>>> type(value)
<type 'str'>
>>> value.split(',')
['6']
>>> type(value.split(','))
<type 'list'>
------------------------
>>> value = ''
>>> type(value)
<type 'str'>
>>> value.split(',')
['']
>>> type(value.split(','))
<type 'list'>

I don't see this require a fix!

Original comment by m.meylan@gmail.com on 21 Sep 2009 at 1:30

GoogleCodeExporter commented 9 years ago
I got this error just right now. Fixed in revision 715

Original comment by batiste....@gmail.com on 26 Sep 2009 at 2:01