mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-01 20:28:44 -04:00
nhs_central is crown org and also we do not update org type while
updating service anymore.
This commit is contained in:
@@ -106,9 +106,6 @@ def dao_add_service_to_organisation(service, organisation_id):
|
||||
db.session.add(service)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def dao_get_invited_organisation_user(user_id):
|
||||
return InvitedOrganisationUser.query.filter_by(id=user_id).one()
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ from app.models import (
|
||||
TemplateRedacted,
|
||||
User,
|
||||
VerifyCode,
|
||||
CROWN_ORGANISATION_TYPES,
|
||||
EMAIL_TYPE,
|
||||
INTERNATIONAL_SMS_TYPE,
|
||||
KEY_TYPE_TEST,
|
||||
@@ -285,6 +286,8 @@ def dao_create_service(
|
||||
service.research_mode = False
|
||||
if organisation:
|
||||
service.crown = organisation.crown
|
||||
elif service.organisation_type in CROWN_ORGANISATION_TYPES:
|
||||
service.crown = True
|
||||
elif service.organisation_type in (NON_CROWN_ORGANISATION_TYPES + ['nhs']):
|
||||
service.crown = False
|
||||
service.count_as_live = not user.platform_admin
|
||||
|
||||
@@ -328,7 +328,9 @@ ORGANISATION_TYPES = [
|
||||
"central", "local", "nhs_central",
|
||||
"nhs_local", "emergency_service", "school_or_college", "other",
|
||||
]
|
||||
NON_CROWN_ORGANISATION_TYPES = ["local", "nhs_central", "nhs_local", "emergency_service", "school_or_college"]
|
||||
|
||||
CROWN_ORGANISATION_TYPES = ["nhs_central"]
|
||||
NON_CROWN_ORGANISATION_TYPES = ["local", "nhs_local", "emergency_service", "school_or_college"]
|
||||
|
||||
|
||||
class OrganisationTypes(db.Model):
|
||||
|
||||
@@ -86,7 +86,7 @@ from app.errors import (
|
||||
)
|
||||
from app.letters.utils import letter_print_day
|
||||
from app.models import (
|
||||
KEY_TYPE_NORMAL, LETTER_TYPE, NON_CROWN_ORGANISATION_TYPES, NOTIFICATION_CANCELLED, Permission, Service,
|
||||
KEY_TYPE_NORMAL, LETTER_TYPE, NOTIFICATION_CANCELLED, Permission, Service,
|
||||
EmailBranding, LetterBranding
|
||||
)
|
||||
from app.notifications.process_notifications import persist_notification, send_notification_to_queue
|
||||
@@ -224,9 +224,6 @@ def update_service(service_id):
|
||||
current_data.update(request.get_json())
|
||||
|
||||
service = service_schema.load(current_data).data
|
||||
org_type = req_json.get('organisation_type', None)
|
||||
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']
|
||||
|
||||
Reference in New Issue
Block a user