Created
April 25, 2011 23:51
-
-
Save andymckay/941493 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/apps/editors/views.py b/apps/editors/views.py | |
index 211a1fe..da3fdad 100644 | |
--- a/apps/editors/views.py | |
+++ b/apps/editors/views.py | |
@@ -310,11 +310,14 @@ def review(request, version_id): | |
statuses = [amo.STATUS_PUBLIC, amo.STATUS_LITE, | |
amo.STATUS_LITE_AND_NOMINATED] | |
- show_diff = (addon.versions.exclude(id=version.id) | |
- .filter(files__isnull=False, | |
+ try: | |
+ show_diff = (addon.versions.exclude(id=version.id) | |
+ .filter(files__isnull=False, | |
created__lt=version.created, | |
files__status__in=statuses) | |
- .exists()) | |
+ .latest()) | |
+ except DoesNotExist: | |
+ show_diff = None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment