substitution vars: replace appname_ with env_

This commit is contained in:
Thomas NOËL 2011-08-04 12:06:09 +00:00
parent 8af3b3b679
commit f69ca38d01
1 changed files with 4 additions and 5 deletions

View File

@ -63,11 +63,10 @@ class HTTPRequest(quixote.http_request.HTTPRequest):
self.form[k] = v.encode(site_charset)
def get_substitution_variables(self):
# env variables starting with "APPNAME_" are exported to
# substitutions variables
# environment variables APPNAME_* are exported to env_*
prefix = get_publisher().APP_NAME.lower() + '_'
vars = {}
variables = {}
for k, v in self.environ.items():
if k.lower().startswith(prefix):
vars['env_' + k.lower()] = v
return vars
variables['env_' + k.lower()[len(prefix):]] = v
return variables