substitution vars: replace appname_ with env_
This commit is contained in:
parent
8af3b3b679
commit
f69ca38d01
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue