Add org types table

This commit is contained in:
Pea Tyczynska
2019-07-10 18:17:33 +01:00
parent 663ab6d96b
commit 9dfc550f46
9 changed files with 93 additions and 15 deletions

View File

@@ -86,7 +86,8 @@ from app.errors import (
)
from app.letters.utils import letter_print_day
from app.models import (
KEY_TYPE_NORMAL, LETTER_TYPE, NOTIFICATION_CANCELLED, Permission, Service, EmailBranding, LetterBranding
KEY_TYPE_NORMAL, LETTER_TYPE, NON_CROWN_ORGANISATION_TYPES, NOTIFICATION_CANCELLED, Permission, Service,
EmailBranding, LetterBranding
)
from app.notifications.process_notifications import persist_notification, send_notification_to_queue
from app.schema_validation import validate
@@ -224,8 +225,8 @@ def update_service(service_id):
service = service_schema.load(current_data).data
org_type = req_json.get('organisation_type', None)
if org_type:
service.crown = org_type == 'central'
if org_type and service.organisation_type in (NON_CROWN_ORGANISATION_TYPES + ["nhs"]):
service.crown = False
if 'email_branding' in req_json:
email_branding_id = req_json['email_branding']