Skip to content

Instantly share code, notes, and snippets.

@claudep
Created June 15, 2013 18:00
Show Gist options
  • Save claudep/5788976 to your computer and use it in GitHub Desktop.
Save claudep/5788976 to your computer and use it in GitHub Desktop.
diff --git a/docs/templatetags/docs.py b/docs/templatetags/docs.py
index f43d998..3029f4c 100644
--- a/docs/templatetags/docs.py
+++ b/docs/templatetags/docs.py
@@ -38,8 +38,6 @@ class AllDocVersionsTag(template.Node):
def __init__(self, docurl, asvar):
self.docurl = template.Variable(docurl)
self.asvar = asvar
- # FIXME
- self.lang = 'en'
def render(self, context):
try:
@@ -48,9 +46,10 @@ class AllDocVersionsTag(template.Node):
return ''
versions = []
+ lang = context.get('lang', 'en')
# Look for each version of the docs.
- for release in DocumentRelease.objects.filter(lang=self.lang):
+ for release in DocumentRelease.objects.filter(lang=lang):
version_root = get_doc_root(release.lang, release.version)
if version_root.exists():
doc_path = get_doc_path(version_root, url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment