don't use cloudfront on preview or staging

cloudfront caching isn't set up on those environments yet, so continue
to use flask for now - in the future we'll want to revert this once
those environments are up and running properly
This commit is contained in:
Leo Hemsted
2016-12-29 12:14:47 +00:00
parent 9e27574298
commit d4f23f1e44
2 changed files with 14 additions and 4 deletions

View File

@@ -135,8 +135,11 @@ def get_logo_url(base_url, branding_path, logo_file):
base_url = parse.urlparse(base_url)
netloc = base_url.netloc
if base_url.netloc.startswith('localhost'):
netloc = 'localhost:6012'
if (
base_url.netloc.startswith('localhost') or
# covers both preview and staging
'notify.works' in base_url.netloc
):
path = '/static' + branding_path + logo_file
else:
if base_url.netloc.startswith('www'):