mirror of
https://github.com/jazzband/django-categories.git
synced 2026-03-16 22:30:24 +00:00
safe mptt registration
This commit is contained in:
parent
10177e3d2e
commit
ab6b48c9d9
1 changed files with 2 additions and 1 deletions
|
|
@ -54,7 +54,8 @@ class Category(models.Model):
|
|||
ancestors = self.get_ancestors()
|
||||
return ' > '.join([force_unicode(i.name) for i in ancestors]+[self.name,])
|
||||
|
||||
mptt.register(Category, order_insertion_by=['name'])
|
||||
try: mptt.register(Category, order_insertion_by=['name'])
|
||||
except: pass
|
||||
|
||||
if RELATION_MODELS:
|
||||
category_relation_limits = reduce(lambda x,y: x|y, RELATIONS)
|
||||
|
|
|
|||
Loading…
Reference in a new issue