Cleanup Page.get_latest_revision

pull/372/head
Karl Hobley 2014-06-26 14:32:45 +01:00
rodzic e1bc2425b6
commit c7c001c9fe
1 zmienionych plików z 1 dodań i 6 usunięć

Wyświetl plik

@ -370,12 +370,7 @@ class Page(MP_Node, ClusterableModel, Indexed):
return self.revisions.create(content_json=self.to_json(), user=user, submitted_for_moderation=submitted_for_moderation)
def get_latest_revision(self):
try:
revision = self.revisions.order_by('-created_at')[0]
except IndexError:
return False
return revision
return self.revisions.order_by('-created_at').first()
def get_latest_revision_as_page(self):
try: