merge from main

This commit is contained in:
Kenneth Kehl
2024-03-01 13:50:09 -08:00
140 changed files with 8031 additions and 5017 deletions

View File

@@ -15,8 +15,9 @@ from app.dao.invited_org_user_dao import (
save_invited_org_user,
)
from app.dao.templates_dao import dao_get_template_by_id
from app.enums import KeyType, NotificationType
from app.errors import InvalidRequest, register_errors
from app.models import EMAIL_TYPE, KEY_TYPE_NORMAL, InvitedOrganizationUser
from app.models import InvitedOrganizationUser
from app.notifications.process_notifications import (
persist_notification,
send_notification_to_queue,
@@ -68,9 +69,9 @@ def invite_user_to_org(organization_id):
recipient=invited_org_user.email_address,
service=template.service,
personalisation={},
notification_type=EMAIL_TYPE,
notification_type=NotificationType.EMAIL,
api_key_id=None,
key_type=KEY_TYPE_NORMAL,
key_type=KeyType.NORMAL,
reply_to_text=invited_org_user.invited_by.email_address,
)
redis_store.set(

View File

@@ -1,4 +1,4 @@
from app.models import INVITED_USER_STATUS_TYPES, ORGANIZATION_TYPES
from app.enums import InvitedUserStatus, OrganizationType
from app.schema_validation.definitions import uuid
post_create_organization_schema = {
@@ -8,7 +8,7 @@ post_create_organization_schema = {
"properties": {
"name": {"type": "string"},
"active": {"type": ["boolean", "null"]},
"organization_type": {"enum": ORGANIZATION_TYPES},
"organization_type": {"enum": [e.value for e in OrganizationType]},
},
"required": ["name", "organization_type"],
}
@@ -20,7 +20,7 @@ post_update_organization_schema = {
"properties": {
"name": {"type": ["string", "null"]},
"active": {"type": ["boolean", "null"]},
"organization_type": {"enum": ORGANIZATION_TYPES},
"organization_type": {"enum": [e.value for e in OrganizationType]},
},
"required": [],
}
@@ -51,6 +51,6 @@ post_update_invited_org_user_status_schema = {
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "POST update organization invite schema",
"type": "object",
"properties": {"status": {"enum": INVITED_USER_STATUS_TYPES}},
"properties": {"status": {"enum": [e.value for e in InvitedUserStatus]}},
"required": ["status"],
}

View File

@@ -20,8 +20,9 @@ from app.dao.organization_dao import (
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.enums import KeyType
from app.errors import InvalidRequest, register_errors
from app.models import KEY_TYPE_NORMAL, Organization
from app.models import Organization
from app.notifications.process_notifications import (
persist_notification,
send_notification_to_queue,
@@ -205,7 +206,7 @@ def send_notifications_on_mou_signed(organization_id):
personalisation={},
notification_type=template.template_type,
api_key_id=None,
key_type=KEY_TYPE_NORMAL,
key_type=KeyType.NORMAL,
reply_to_text=notify_service.get_default_reply_to_email_address(),
)
saved_notification.personalisation = personalisation