Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@jacobian jacobian authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 releases/models.py
View
6 releases/models.py
@@ -22,11 +22,11 @@ def current(self):
return self.final().order_by('-minor', '-micro')[0]
def current_version(self):
- current_version = cache.get(Release.DEFAULT_CACHE_KEY)
- if not current_version:
+ current_version = cache.get(Release.DEFAULT_CACHE_KEY, None)
+ if current_version is None:
try:
current_version = self.current().version
- except Release.DoesNotExist:
+ except (Release.DoesNotExist, IndexError):
current_version = ''
cache.set(
Release.DEFAULT_CACHE_KEY,
Please sign in to comment.
Something went wrong with that request. Please try again.