Skip to content

Commit

Permalink
Render footer properly as a request context
Browse files Browse the repository at this point in the history
  • Loading branch information
ericholscher committed Oct 7, 2015
1 parent f56adf6 commit e3c5879
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion readthedocs/core/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def readthedocs_processor(request):
'PRODUCTION_DOMAIN': getattr(settings, 'PRODUCTION_DOMAIN', None),
'USE_SUBDOMAINS': getattr(settings, 'USE_SUBDOMAINS', None),
'GLOBAL_ANALYTICS_CODE': getattr(settings, 'GLOBAL_ANALYTICS_CODE', 'UA-17997319-1'),
'TEMPLATE_ROOT': getattr(settings, 'TEMPLATE_ROOT', None) + '/',
'SITE_ROOT': getattr(settings, 'SITE_ROOT', '') + '/',
'TEMPLATE_ROOT': getattr(settings, 'TEMPLATE_ROOT', '') + '/',
}
return exports
7 changes: 3 additions & 4 deletions readthedocs/restapi/views/footer_views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from django.shortcuts import get_object_or_404
from django.template import loader as template_loader
from django.template import RequestContext, loader as template_loader
from django.conf import settings
from django.core.context_processors import csrf

from rest_framework import decorators, permissions
from rest_framework.renderers import JSONPRenderer, JSONRenderer, BrowsableAPIRenderer
Expand Down Expand Up @@ -121,8 +120,8 @@ def footer_html(request):
'bitbucket_url': version.get_bitbucket_url(docroot, page_slug, source_suffix),
}

context.update(csrf(request))
html = template_loader.get_template('restapi/footer.html').render(context)
request_context = RequestContext(request, context)
html = template_loader.get_template('restapi/footer.html').render(request_context)
resp_data = {
'html': html,
'version_active': version.active,
Expand Down

0 comments on commit e3c5879

Please sign in to comment.