Skip to content

Commit

Permalink
Fixes a bug trying to set active on decendants before object is saved.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corey Oordt committed Aug 29, 2011
1 parent 1e049b9 commit 2a0b476
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion categories/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,12 @@ def save(self, *args, **kwargs):
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'
Expand Down

0 comments on commit 2a0b476

Please sign in to comment.