Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactor request_type detection usage

  • Loading branch information...
commit 26c777a74af1dfa6944bc2e927e7437b2b3341f7 1 parent 1cc93ca
@amol- amol- authored
Showing with 3 additions and 2 deletions.
  1. +1 −0  tg/controllers/dispatcher.py
  2. +2 −2 tg/decorators.py
View
1  tg/controllers/dispatcher.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
4 tg/decorators.py
@@ -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', '*/*')
Please sign in to comment.
Something went wrong with that request. Please try again.