postgresql - Added/updated pages in wrong place in Django CMS 3.0 (mptt) article tree using postgres -


for https://developer.ubuntu.com use django cms 3.0.6 (mptt) , we're happy it.

recently added functionality import markdown docs bzr branches of projects, can have cronjobs update articles whenever things changed in of upstream projects interested in. took me time complete it, got working. locally used sqlite (the default) , happy. once deployed staging, import worked well, articles added or updated script ended in different place in article tree. after time reproduce local postgres installation.

we tracking issue here: https://bugs.launchpad.net/developer-ubuntu-com/+bug/1506861

i'm bit lost , don't quite know how debug this.

i put test-case , it's basically:

$ bzr branch lp:~developer-ubuntu-com-dev/developer-ubuntu-com/debug-md-importer $ cd debug-md-importer $ virtualenv ./env $ ./env/bin/pip install -r requirements.txt $ ./env/bin/pip install django psycopg2 

then apply diff http://pastebin.ubuntu.com/12798510/ developer_portal/settings.py , run

$ sudo apt install python-pip python-dev libpq-dev postgresql postgresql-contrib $ sudo -u postgres psql -c "create user developerportal_user password '123abc';" 

to see issue in action run:

$ ./postgres-retry.sh 

in postgres setting and

$ ./sqlite-retry.sh 

in sqlite setting.

the scripts create new db scratch, run importer debug messages , run runserver you, can check in pages list how structure changed.

current state of things: sqlite fine , postgres has article tree messed up.

all relevant code problem can found in developer_portal/management/commands/import-external-docs-branches.py

if give me pointer, it'd much appreciated.

thanks lot in advance.

have great day, daniel

i see http://bazaar.launchpad.net/~developer-ubuntu-com-dev/developer-ubuntu-com/debug-md-importer/view/head:/requirements.txt#l18 on django cms 3.0.6, means you're using django mptt.

generally, of tree problems people have encountered django cms have turned out corruption after moves, related django mptt.

if haven't done so, might try 1 of following:

  • instead of using django-mptt==0.6.1 try lastest version of https://github.com/django-mptt/django-mptt
  • i haven't had opportunity run through process, if it's possible, try running manage.py cms fix-mptt command after each operation
  • in django cms 3.1, began using treebeard instead of mptt. if you're able try using 3.1 instead of 3.0.x without additional work, might useful experiment.

Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -