Mark which brands are used as default on list

So that:
- we can see when a brand should be getting used as a default but isn’t
- we’re careful updating brands which will get auto-applied to new
  services
This commit is contained in:
Chris Hill-Scott
2018-09-03 14:06:07 +01:00
parent 243fdb0260
commit 46dcaf3e54
2 changed files with 24 additions and 9 deletions

View File

@@ -11,8 +11,7 @@ from app.main.s3_client import (
persist_logo,
upload_logo,
)
from app.main.views.service_settings import get_branding_as_value_and_label
from app.utils import get_cdn_domain, user_is_platform_admin
from app.utils import AgreementInfo, get_cdn_domain, user_is_platform_admin
@main.route("/email-branding", methods=['GET', 'POST'])
@@ -23,9 +22,10 @@ def email_branding():
return render_template(
'views/email-branding/select-branding.html',
email_brandings=get_branding_as_value_and_label(brandings),
email_brandings=_add_domain_info(brandings),
search_form=SearchTemplatesForm(),
show_search_box=len(brandings) > 9,
agreement_info=AgreementInfo,
)
@@ -129,3 +129,11 @@ def create_email_branding(logo=None):
cdn_url=get_cdn_domain(),
logo=logo
)
def _add_domain_info(email_brands):
for brand in email_brands:
yield dict(
domain_owner=AgreementInfo(brand.get('domain') or '').owner,
**brand
)