Skip to content

Commit 7d71aa0

Browse files
author
Martin J. Laubach
committed
Microoptimisation for inactive pages.
1 parent b59cb73 commit 7d71aa0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

feincms/module/page/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ def is_active(self):
213213
if not self.pk:
214214
return False
215215

216+
# No need to hit DB if page itself is inactive
217+
if not self.active:
218+
return False
219+
216220
pages = self.__class__.objects.active().filter(
217221
tree_id=self.tree_id,
218222
lft__lte=self.lft,

0 commit comments

Comments
 (0)