December 25, 2014

Fixing a category assigned with itself as parent in Satchmo

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.

[tags]satchmo,django[/tags]

Share and Enjoy:
  • services sprite Fixing a category assigned with itself as parent in Satchmo
  • services sprite Fixing a category assigned with itself as parent in Satchmo
  • services sprite Fixing a category assigned with itself as parent in Satchmo
  • services sprite Fixing a category assigned with itself as parent in Satchmo
  • services sprite Fixing a category assigned with itself as parent in Satchmo
  • services sprite Fixing a category assigned with itself as parent in Satchmo
  • services sprite Fixing a category assigned with itself as parent in Satchmo
  • services sprite Fixing a category assigned with itself as parent in Satchmo

Related posts:

  1. Howto use Satchmo as an App I'm going to be using Satchmo to power the backend...
  2. Setting up Satchmo on a Debian Server At the request of people on the satchmo-users mailing list,...
  3. Pushing toward a Satchmo Release I’ve been enjoying being a core developer on the Satchmo...
  4. Amazon Payments for Satchmo I’m not sure how I missed it before, but PayPal...
  5. Fixing Exim sender callout error On my new dedicated server, I've been getting reports of...

About Bruce Kroeze

Comments

  1. Kyle says:

    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.

Speak Your Mind

*