Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3263 from jezdez/bug1169673-regression
Browse files Browse the repository at this point in the history
Fix bug 1174820 - Revert the get_previous changes made in bug #1169673.
  • Loading branch information
groovecoder committed Jun 15, 2015
2 parents 9621183 + c715cac commit b5726a1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kuma/wiki/models.py
Expand Up @@ -1825,8 +1825,11 @@ def get_previous(self):
Returns the previous approved revision or None.
"""
try:
return self.get_previous_by_created(is_approved=True)
except Revision.DoesNotExist:
return self.document.revisions.filter(
is_approved=True,
created__lt=self.created,
).order_by('-created')[0]
except IndexError:
return None

@cached_property
Expand Down

0 comments on commit b5726a1

Please sign in to comment.