The code was literally just this line:
I have no idea why the sql is going without a condition, the static page does get deleted. I only noticed the problem because the next lines were:
if not count:
raise HTTP(404)
And I was constantly getting a 404.
I tested this on the command line after inserting a static page
<Row {'body': '<p>vefvefv</p>', 'lang': 'pt', 'name': 'vevefv', 'is_active': Tru
e, 'created_by': 1L, 'created_on': datetime.datetime(2014, 7, 9, 16, 8, 51), 'mo
dified_on': datetime.datetime(2014, 7, 9, 16, 8, 51), 'modified_by': 1L, 'id': 1
L}>
>>> count
0
So as you can see it's returning zero when in fact it's deleting one record, as one can see in the final query that nothing is returned.