Skip to content

Commit

Permalink
Refactor request_type detection usage
Browse files Browse the repository at this point in the history
  • Loading branch information
amol- committed Jan 8, 2013
1 parent 1cc93ca commit 26c777a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions tg/controllers/dispatcher.py
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions tg/decorators.py
Expand Up @@ -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', '*/*')
Expand Down

0 comments on commit 26c777a

Please sign in to comment.