-
-
Notifications
You must be signed in to change notification settings - Fork 942
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using the models rather than hardcoded values.
- Loading branch information
1 parent
2459516
commit 61c6eb6
Showing
2 changed files
with
8 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
from django.conf import settings | ||
from django.core.cache import cache | ||
|
||
from django_website.docs.models import DocumentRelease | ||
|
||
def recent_release(request): | ||
return {'RECENT_RELEASE': settings.RECENT_RELEASE} | ||
recent_release = cache.get('recent_release') | ||
if not recent_release: | ||
recent_release = DocumentRelease.objects.default().version | ||
cache.set('recent_release', recent_release) | ||
return {'RECENT_RELEASE': recent_release} |
This file contains 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