This commit is contained in:
Trever Fischer
2012-04-17 16:34:11 -04:00
parent 4d8d3ff768
commit 075c675f01

View File

@@ -44,7 +44,10 @@ class Forum(MPTTModel):
def freshestTopic(self):
freshestForum = self.get_descendants(True).extra(order_by = ['-topic__updated'])[0]
return freshestForum.topic_set.extra(order_by = ['-updated'])[0]
try:
return freshestForum.topic_set.extra(order_by = ['-updated'])[0]
except IndexError, e:
return None
@models.permalink
def get_absolute_url(self):