create, edit and use email branding instead of organisation

notable things that have been kept until migration is complete:

* passing in `organisation` to update_service will update email branding
* both `/email-branding` and `/organisation` hit the same code
* service endpoints still return organisation as well as email branding
This commit is contained in:
Leo Hemsted
2018-02-05 12:02:35 +00:00
parent cea52929d3
commit 2f79da8702
18 changed files with 281 additions and 279 deletions

View File

@@ -184,10 +184,15 @@ def update_service(service_id):
if org_type:
service.crown = org_type == 'central'
# TODO: remove this block after admin is updated to refer to email branding
if 'organisation' in req_json:
org_id = req_json['organisation']
service.email_branding = None if not org_id else EmailBranding.query.get(org_id)
if 'email_branding' in req_json:
email_branding_id = req_json['email_branding']
service.email_branding = None if not email_branding_id else EmailBranding.query.get(email_branding_id)
dao_update_service(service)
if service_going_live: