diff --git a/beat/web/attestations/views.py b/beat/web/attestations/views.py index 64e73a0ed72ff1f1a6e6ffda729ff754951ae52d..62d10e536c612962eaad659349b70a8f64fcb619 100644 --- a/beat/web/attestations/views.py +++ b/beat/web/attestations/views.py @@ -31,8 +31,7 @@ from django.shortcuts import get_object_or_404 -from django.shortcuts import render_to_response -from django.template import RequestContext +from django.shortcuts import render from django.contrib.auth.models import User from django.db.models import Q @@ -46,13 +45,13 @@ def view(request, number): (has_access, _) = attestation.experiment.accessibility_for(request.user) # Render the page - return render_to_response('attestations/view.html', - dict( - attestation=attestation, - has_access=has_access, - owner=(attestation.experiment.author == request.user), - ), - context_instance=RequestContext(request)) + return render(request, + 'attestations/view.html', + dict( + attestation=attestation, + has_access=has_access, + owner=(attestation.experiment.author == request.user) + )) def ls(request, author_name): @@ -75,14 +74,13 @@ def ls(request, author_name): objects = objects.order_by('-locked', 'expiration_date') - return render_to_response('attestations/list.html', - dict( - objects=objects, - author=author, - owner=(request.user==author), - ), - context_instance=RequestContext(request), - ) + return render(request, + 'attestations/list.html', + dict( + objects=objects, + author=author, + owner=(request.user == author) + )) def public_ls(request): @@ -91,11 +89,10 @@ def public_ls(request): # orders so that recent objects are displayed first objects = Attestation.objects.filter(locked=False).order_by('-publication_date') - return render_to_response('attestations/list.html', - dict( - objects=objects, - author=request.user, #anonymous - owner=False, - ), - context_instance=RequestContext(request), - ) + return render(request, + 'attestations/list.html', + dict( + objects=objects, + author=request.user, # anonymous + owner=False, + ))