Permalink
Browse files

Refactor request_type detection usage

  • Loading branch information...
1 parent 1cc93ca commit 26c777a74af1dfa6944bc2e927e7437b2b3341f7 @amol- amol- committed Jan 8, 2013
Showing with 3 additions and 2 deletions.
  1. +1 −0 tg/controllers/dispatcher.py
  2. +2 −2 tg/decorators.py
@@ -65,6 +65,7 @@ def _get_dispatchable(self, url_path):
state = DispatchState(pylons.request,
self, params, url_path, pylons.config.get('ignore_parameters', []))
+ pylons.request.response_type = None
if not pylons.config.get('disable_request_extensions', False):
ext = state.extension
if ext is not None:
View
@@ -161,8 +161,8 @@ def lookup_template_engine(self, request):
"""
- if hasattr(request, 'response_type'
- ) and request.response_type in self.engines:
+ response_type = getattr(request, 'response_type', None)
+ if response_type is not None and response_type in self.engines:
accept_types = request.response_type
else:
accept_types = request.headers.get('accept', '*/*')

0 comments on commit 26c777a

Please sign in to comment.