When creating a new NHS org, set default email branding to NHS

This is more appropriate default for that org than gov.uk branding
and will help us with our work to make setting the branding more
self-service.
This commit is contained in:
Pea Tyczynska
2022-04-08 17:39:55 +01:00
parent cf66d7c344
commit b1ed722252
4 changed files with 48 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ from app.dao.services_dao import dao_fetch_service_by_id
from app.dao.templates_dao import dao_get_template_by_id
from app.dao.users_dao import get_user_by_id
from app.errors import InvalidRequest, register_errors
from app.models import KEY_TYPE_NORMAL, Organisation
from app.models import KEY_TYPE_NORMAL, NHS_ORGANISATION_TYPES, Organisation
from app.notifications.process_notifications import (
persist_notification,
send_notification_to_queue,
@@ -93,6 +93,9 @@ def create_organisation():
validate(data, post_create_organisation_schema)
if data["organisation_type"] in NHS_ORGANISATION_TYPES:
data["email_branding_id"] = current_app.config['NHS_EMAIL_BRANDING_ID']
organisation = Organisation(**data)
dao_create_organisation(organisation)
return jsonify(organisation.serialize()), 201