Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Prevent the docs context processor from crashing on an empty database.

  • Loading branch information...
commit aa45d1777098d9f8ef89dd27a7bc2c3863395d1f 1 parent f7fbe4e
@aaugustin aaugustin authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 docs/context_processors.py
View
5 docs/context_processors.py
@@ -6,7 +6,10 @@
def recent_release(request):
recent_release = cache.get('recent_release')
if not recent_release:
- recent_release = DocumentRelease.objects.default().version
+ try:
+ recent_release = DocumentRelease.objects.default().version
+ except DocumentRelease.DoesNotExist:
+ recent_release = 'dev'
cache.set(
DocumentRelease.DEFAULT_CACHE_KEY,
recent_release,
Please sign in to comment.
Something went wrong with that request. Please try again.