mirror of
https://github.com/jazzband/django-categories.git
synced 2026-03-16 22:30:24 +00:00
Fixes a bug trying to set active on decendants before object is saved.
This commit is contained in:
parent
1e049b9205
commit
2a0b4768a3
1 changed files with 2 additions and 1 deletions
|
|
@ -101,11 +101,12 @@ class Category(MPTTModel):
|
|||
self.thumbnail_width = width
|
||||
self.thumbnail_height = height
|
||||
|
||||
super(Category, self).save(*args, **kwargs)
|
||||
|
||||
for item in self.get_descendants():
|
||||
if item.active != self.active:
|
||||
item.active = self.active
|
||||
item.save()
|
||||
super(Category, self).save(*args, **kwargs)
|
||||
|
||||
class Meta:
|
||||
verbose_name_plural = 'categories'
|
||||
|
|
|
|||
Loading…
Reference in a new issue