diff --git a/boards/views/all_threads.py b/boards/views/all_threads.py --- a/boards/views/all_threads.py +++ b/boards/views/all_threads.py @@ -33,7 +33,7 @@ class AllThreadsView(PostMixin, BaseBoar super(AllThreadsView, self).__init__() def get(self, request, page=DEFAULT_PAGE, form=None): - params = dict() + params = self.get_context_data(request=request) if not form: form = ThreadForm(error_class=PlainErrorList) diff --git a/boards/views/base.py b/boards/views/base.py --- a/boards/views/base.py +++ b/boards/views/base.py @@ -14,15 +14,7 @@ CONTEXT_FORM = 'form' class BaseBoardView(View): def get_context_data(self, **kwargs): - """ - This method is deprecated. You need to use dicts instead of context - instances in all places it is used now. - """ - - request = kwargs['request'] - context = RequestContext(request) - - return context + return dict() @transaction.atomic def _ban_current_user(self, request): diff --git a/boards/views/not_found.py b/boards/views/not_found.py --- a/boards/views/not_found.py +++ b/boards/views/not_found.py @@ -9,10 +9,9 @@ class NotFoundView(BaseBoardView): """ def get(self, request): - context = self.get_context_data(request=request) + params = self.get_context_data() - # TODO Use dict here - response = render(request, 'boards/404.html', context_instance=context) + response = render(request, 'boards/404.html', params) response.status_code = 404 return response diff --git a/boards/views/settings.py b/boards/views/settings.py --- a/boards/views/settings.py +++ b/boards/views/settings.py @@ -13,7 +13,7 @@ CONTEXT_HIDDEN_TAGS = 'hidden_tags' class SettingsView(BaseBoardView): def get(self, request): - context = self.get_context_data(request=request) + params = self.get_context_data() settings_manager = get_settings_manager(request) selected_theme = settings_manager.get_theme() @@ -21,11 +21,11 @@ class SettingsView(BaseBoardView): form = SettingsForm(initial={FORM_THEME: selected_theme}, error_class=PlainErrorList) - context[CONTEXT_FORM] = form - context[CONTEXT_HIDDEN_TAGS] = settings_manager.get_hidden_tags() + params[CONTEXT_FORM] = form + params[CONTEXT_HIDDEN_TAGS] = settings_manager.get_hidden_tags() # TODO Use dict here - return render(request, 'boards/settings.html', context_instance=context) + return render(request, 'boards/settings.html', params) def post(self, request): settings_manager = get_settings_manager(request) diff --git a/boards/views/static.py b/boards/views/static.py --- a/boards/views/static.py +++ b/boards/views/static.py @@ -10,8 +10,4 @@ class StaticPageView(BaseBoardView): Show a static page that needs only tags list and a CSS """ - context = self.get_context_data(request=request) - - # TODO Use dict here - return render(request, 'boards/staticpages/' + name + '.html', - context_instance=context) + return render(request, 'boards/staticpages/' + name + '.html') diff --git a/boards/views/tag_threads.py b/boards/views/tag_threads.py --- a/boards/views/tag_threads.py +++ b/boards/views/tag_threads.py @@ -23,17 +23,17 @@ class TagView(AllThreadsView, Dispatcher return tag.get_threads() def get_context_data(self, **kwargs): - context = super(TagView, self).get_context_data(**kwargs) + params = super(TagView, self).get_context_data(**kwargs) settings_manager = get_settings_manager(kwargs['request']) tag = get_object_or_404(Tag, name=self.tag_name) - context[PARAM_TAG] = tag + params[PARAM_TAG] = tag - context[PARAM_FAV_TAGS] = settings_manager.get_fav_tags() - context[PARAM_HIDDEN_TAGS] = settings_manager.get_hidden_tags() + params[PARAM_FAV_TAGS] = settings_manager.get_fav_tags() + params[PARAM_HIDDEN_TAGS] = settings_manager.get_hidden_tags() - return context + return params def get(self, request, tag_name, page=DEFAULT_PAGE, form=None): self.tag_name = tag_name