Commit df34da69 by Czémán Arnold

dashboard, requests: eleminate more RequestContexts

parent 98e0ef2b
...@@ -27,7 +27,6 @@ from django.db.models import Count ...@@ -27,7 +27,6 @@ from django.db.models import Count
from django.forms.models import inlineformset_factory from django.forms.models import inlineformset_factory
from django.http import HttpResponse from django.http import HttpResponse
from django.shortcuts import redirect from django.shortcuts import redirect
from django.template import RequestContext
from django.template.loader import render_to_string from django.template.loader import render_to_string
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.views.generic import DetailView, TemplateView, View from django.views.generic import DetailView, TemplateView, View
...@@ -330,9 +329,12 @@ class NodeActivityView(LoginRequiredMixin, SuperuserRequiredMixin, View): ...@@ -330,9 +329,12 @@ class NodeActivityView(LoginRequiredMixin, SuperuserRequiredMixin, View):
response = { response = {
'activities': render_to_string( 'activities': render_to_string(
"dashboard/node-detail/_activity-timeline.html", "dashboard/node-detail/_activity-timeline.html",
RequestContext(request, {'activities': activities, {
'show_show_all': show_show_all} 'activities': activities,
).flatten()) 'show_show_all': show_show_all
},
request
)
} }
return HttpResponse( return HttpResponse(
......
...@@ -29,7 +29,6 @@ from django.core.exceptions import SuspiciousOperation ...@@ -29,7 +29,6 @@ from django.core.exceptions import SuspiciousOperation
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.http import HttpResponse from django.http import HttpResponse
from django.shortcuts import redirect, render_to_response, render from django.shortcuts import redirect, render_to_response, render
from django.template import RequestContext
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.views.decorators.http import require_GET, require_POST from django.views.decorators.http import require_GET, require_POST
from django.views.generic import TemplateView from django.views.generic import TemplateView
...@@ -65,7 +64,7 @@ class StoreList(LoginRequiredMixin, TemplateView): ...@@ -65,7 +64,7 @@ class StoreList(LoginRequiredMixin, TemplateView):
context = self.get_context_data(**kwargs) context = self.get_context_data(**kwargs)
return render_to_response( return render_to_response(
"dashboard/store/_list-box.html", "dashboard/store/_list-box.html",
RequestContext(self.request, context).flatten(), context, self.request
) )
else: else:
return super(StoreList, self).get(*args, **kwargs) return super(StoreList, self).get(*args, **kwargs)
......
...@@ -19,7 +19,6 @@ from django.forms import ( ...@@ -19,7 +19,6 @@ from django.forms import (
Textarea, ValidationError Textarea, ValidationError
) )
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.template import RequestContext
from django.template.loader import render_to_string from django.template.loader import render_to_string
from sizefield.widgets import FileSizeWidget from sizefield.widgets import FileSizeWidget
...@@ -68,8 +67,7 @@ class InitialFromFileMixin(object): ...@@ -68,8 +67,7 @@ class InitialFromFileMixin(object):
super(InitialFromFileMixin, self).__init__(*args, **kwargs) super(InitialFromFileMixin, self).__init__(*args, **kwargs)
self.initial['message'] = render_to_string( self.initial['message'] = render_to_string(
self.initial_template, self.initial_template, {}, request
RequestContext(request, {}).flatten(),
) )
def clean_message(self): def clean_message(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment