mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 15:15:38 -05:00
Merge pull request #2557 from alphagov/more_org_types
Introduce new organisation types and organisation_types db table
This commit is contained in:
@@ -101,6 +101,8 @@ def dao_add_service_to_organisation(service, organisation_id):
|
||||
|
||||
organisation.services.append(service)
|
||||
service.organisation_type = organisation.organisation_type
|
||||
service.crown = organisation.crown
|
||||
|
||||
db.session.add(service)
|
||||
|
||||
|
||||
|
||||
@@ -38,9 +38,11 @@ from app.models import (
|
||||
TemplateRedacted,
|
||||
User,
|
||||
VerifyCode,
|
||||
CROWN_ORGANISATION_TYPES,
|
||||
EMAIL_TYPE,
|
||||
INTERNATIONAL_SMS_TYPE,
|
||||
KEY_TYPE_TEST,
|
||||
NON_CROWN_ORGANISATION_TYPES,
|
||||
SMS_TYPE,
|
||||
LETTER_TYPE,
|
||||
)
|
||||
@@ -282,7 +284,12 @@ def dao_create_service(
|
||||
service.id = service_id or uuid.uuid4() # must be set now so version history model can use same id
|
||||
service.active = True
|
||||
service.research_mode = False
|
||||
service.crown = service.organisation_type == 'central'
|
||||
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:
|
||||
service.crown = False
|
||||
service.count_as_live = not user.platform_admin
|
||||
|
||||
for permission in service_permissions:
|
||||
|
||||
Reference in New Issue
Block a user