Coder’s Eye

A site about one of the three passions in my life.

Coder’s Eye header image 2

Fixing a category assigned with itself as parent in Satchmo

June 3rd, 2008 · 1 Comment

One annoying possibility in Satchmo is that administrators sometimes accidentally set a category as its own parent. This causes an infinite loop and hangs the site. So you can’t even use Django to fix the error.

Luckily, the solution is simple. At the commandline do like so:


/opt/webapps/mystore $ ./manage.py dbshell
mysql> update product_category set parent_id=null where id=parent_id;
mysql> quit

Problem solved.

Technorati Tags: ,

Tags: Satchmo

Bookmark this article

del.icio.us:Fixing a category assigned with itself as parent in Satchmo digg:Fixing a category assigned with itself as parent in Satchmo spurl:Fixing a category assigned with itself as parent in Satchmo wists:Fixing a category assigned with itself as parent in Satchmo simpy:Fixing a category assigned with itself as parent in Satchmo newsvine:Fixing a category assigned with itself as parent in Satchmo blinklist:Fixing a category assigned with itself as parent in Satchmo furl:Fixing a category assigned with itself as parent in Satchmo reddit:Fixing a category assigned with itself as parent in Satchmo fark:Fixing a category assigned with itself as parent in Satchmo blogmarks:Fixing a category assigned with itself as parent in Satchmo Y!:Fixing a category assigned with itself as parent in Satchmo smarking:Fixing a category assigned with itself as parent in Satchmo magnolia:Fixing a category assigned with itself as parent in Satchmo segnalo:Fixing a category assigned with itself as parent in Satchmo gifttagging:Fixing a category assigned with itself as parent in Satchmo

1 response so far ↓

  • 1 Kyle // Jun 3, 2008 at 12:01 pm

    I had a similar problem with Pages in our CMS — you could assign a page’s parent to be itself.

    The more preemptive solution we decided on was to simply override save(), and set `parent = None` if self.parent = self.

Leave a Comment