Skip to content
Snippets Groups Projects
Commit 1a684c38 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[navigation][views] Moved from render_to_response to render

render_to_response is deprecated in Django 2.0 and render has
been available since 1.3. It's shorter to write and avoids the
writing of context_instance=RequestContext(request) in each of
its call.
parent 81e956a6
No related branches found
No related tags found
2 merge requests!2551.4.x,!238Upgrade to django 1.11
......@@ -25,10 +25,8 @@
# #
###############################################################################
from django.shortcuts import render_to_response
from django.shortcuts import get_object_or_404
from django.template import RequestContext, Context, loader
from django.contrib import messages
from django.shortcuts import render
from django.template import Context, loader
from django.conf import settings
from .middleware import remove_banner_message
......@@ -50,11 +48,9 @@ def terms_of_service(request):
settings.LEGAL_DISCLAIMER_VERSION
remove_banner_message(request)
return render_to_response(
'navigation/terms_of_service.html',
dict(contents=contents),
context_instance=RequestContext(request),
)
return render(request,
'navigation/terms_of_service.html',
dict(contents=contents))
#------------------------------------------------
......@@ -77,11 +73,9 @@ def legal_disclaimer(request):
remove_banner_message(request)
return render_to_response(
'navigation/legal_disclaimer.html',
dict(contents=contents),
context_instance=RequestContext(request),
)
return render(request,
'navigation/legal_disclaimer.html',
dict(contents=contents))
......@@ -91,8 +85,4 @@ def legal_disclaimer(request):
def contact(request):
'''Returns an HTML page with the contact information'''
return render_to_response(
'navigation/contact.html',
dict(),
context_instance=RequestContext(request),
)
return render(request, 'navigation/contact.html')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment