Skip to content

Commit

Permalink
[svn] Moved redirect declaration to only be created once... premature…
Browse files Browse the repository at this point in the history
… optimization... perhaps.

--HG--
branch : trunk
  • Loading branch information
bbangert committed Jul 22, 2006
1 parent 40dd72b commit 362b936
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pylons/wsgiapp.py
Expand Up @@ -49,6 +49,11 @@ def __init__(self, mapper, package_name, globals, default_charset='UTF-8'):
self.c = RequestLocal()
config = globals.pylons_config

# Create the redirect function we'll use and save it
def redirect_to(url):
raise httpexceptions.HTTPFound(url)
self.redirect_to = redirect_to

# Initialize Buffet and all our template engines, default engine is the
# first in the template_engines list
def_eng = config.template_engines.pop(0)
Expand Down Expand Up @@ -130,9 +135,7 @@ def resolve(self, environ, start_response):
config = request_config()
config.mapper = self.mapper
config.environ = environ
def redirect_to(url):
raise httpexceptions.HTTPFound(url)
config.redirect = redirect_to
config.redirect = self.redirect_to
match = config.mapper_dict
if not match:
return None
Expand Down

0 comments on commit 362b936

Please sign in to comment.