Fix latestTopic and lastPost returns
This commit is contained in:
@@ -43,7 +43,7 @@ class Forum(MPTTModel):
|
||||
return self.topic_set.count()
|
||||
|
||||
def latestTopic(self):
|
||||
return self.topic_set.extra(order_by = ['created'])
|
||||
return self.topic_set.extra(order_by = ['created'])[0]
|
||||
|
||||
@models.permalink
|
||||
def get_absolute_url(self):
|
||||
@@ -69,7 +69,7 @@ class Topic(models.Model):
|
||||
super(Topic, self).save(*args, **kwargs)
|
||||
|
||||
def lastPost(self):
|
||||
return self.rootPost.get_descendants(True).extra(order_by = ['updated'])
|
||||
return self.rootPost.get_descendants(True).extra(order_by = ['updated'])[0]
|
||||
|
||||
@models.permalink
|
||||
def get_absolute_url(self):
|
||||
|
Reference in New Issue
Block a user