mirror of
https://github.com/jazzband/django-categories.git
synced 2026-03-16 22:30:24 +00:00
Merge branch '0.8.7'
This commit is contained in:
commit
d811f6677c
2 changed files with 9 additions and 5 deletions
|
|
@ -1,7 +1,7 @@
|
|||
__version_info__ = {
|
||||
'major': 0,
|
||||
'minor': 8,
|
||||
'micro': 6,
|
||||
'micro': 7,
|
||||
'releaselevel': 'final',
|
||||
'serial': 1
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,10 +107,14 @@ class Category(MPTTModel):
|
|||
|
||||
super(Category, self).save(*args, **kwargs)
|
||||
|
||||
for item in self.get_descendants():
|
||||
if item.active != self.active:
|
||||
item.active = self.active
|
||||
item.save()
|
||||
# While you can activate an item without activating its descendants,
|
||||
# It doesn't make sense that you can deactivate an item and have its
|
||||
# decendants remain active.
|
||||
if not self.active:
|
||||
for item in self.get_descendants():
|
||||
if item.active != self.active:
|
||||
item.active = self.active
|
||||
item.save()
|
||||
|
||||
class Meta:
|
||||
verbose_name_plural = 'categories'
|
||||
|
|
|
|||
Loading…
Reference in a new issue