Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Made Release.objects.current_version() more fail more silently.

This makes tests run better, and also breaks the dependancy of having to
have a current release for the site to run.
  • Loading branch information...
commit 7ab5f9f7f2ce69afda679ed3467c9bb307e1d0a6 1 parent 3ef73cf
Jacob Kaplan-Moss authored April 01, 2013

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  releases/models.py
6  releases/models.py
@@ -22,11 +22,11 @@ def current(self):
22 22
         return self.final().order_by('-minor', '-micro')[0]
23 23
 
24 24
     def current_version(self):
25  
-        current_version = cache.get(Release.DEFAULT_CACHE_KEY)
26  
-        if not current_version:
  25
+        current_version = cache.get(Release.DEFAULT_CACHE_KEY, None)
  26
+        if current_version is None:
27 27
             try:
28 28
                 current_version = self.current().version
29  
-            except Release.DoesNotExist:
  29
+            except (Release.DoesNotExist, IndexError):
30 30
                 current_version = ''
31 31
             cache.set(
32 32
                 Release.DEFAULT_CACHE_KEY,

0 notes on commit 7ab5f9f

Please sign in to comment.
Something went wrong with that request. Please try again.