Closed mitar closed 13 years ago
This is on Django 1.2.4.
It works normally with sqlite database. But not on PostgreSQL (8.4). TransactionMiddleware does not seem to have anything to do with that.
Pages with the same slug can still be added. And then there is an error when you want to save them, saying that there is a duplicate slug.
I think this it is not really necessary to prevent duplicated slugs, only published pages should not have the same slug. But sometimes it is OK to have unpublished pages prepared to swap them around.
Could you please test and confirm it still happens after https://github.com/divio/django-cms/commit/f49e929eac103c8c37005c5291d909c5f170d22c ?
No difference.
I am using also reversion. Maybe this is the cause?
Yes. This is it. I removed it from enabled Django applications and now it works correctly.
I am using d4bc1a368add0ad5b24e40f1695e82ee9b4d1742 version of django-reversion.
I can not reproduce this bug. I enabled the TransactionMiddleware, django-reversion and stuff. Adding pages just work and there are no transaction exceptions.
can't reproduce, closed until we have a test
You tested on PostgreSQL?
Tested sqlite, mysql and postres.
Hm. OK.
With current develop branch (199d1a2c5b68a5b8eab2e1cdced452b24d8186b8) when using TransactionMiddleware (listed as last in MIDDLEWARE_CLASSES), page is still added when adding through admin, when exception is raised. For example I get this stacktrace, but page is added:
Futhermore, page can be added with the same slug multiple times (for example just reloading the POST request multiple times on the exception above).
Hm, it seems it is the same with or without TransactionMiddleware.
I am also not sure why this exception is raised in the first place. So currently having almost the installation as described in the tutorial gives you such errors.