Revert "Merge pull request #2887 from alphagov/cache-the-serialised-things"

This reverts commit b8c2c6b291, reversing
changes made to 351aca2c5a.
This commit is contained in:
Chris Hill-Scott
2020-06-26 13:42:44 +01:00
parent b8fe7b8e61
commit 7e85e37e1d
15 changed files with 50 additions and 215 deletions

View File

@@ -7,8 +7,6 @@ from app.models import (
MOBILE_TYPE, EMAIL_TYPE,
KEY_TYPE_TEST, KEY_TYPE_TEAM, KEY_TYPE_NORMAL)
from app.dao.services_dao import dao_fetch_service_by_id
def get_recipients_from_request(request_json, key, type):
return [(type, recipient) for recipient in request_json.get(key)]
@@ -35,10 +33,6 @@ def service_allowed_to_send_to(recipient, service, key_type, allow_whitelisted_r
if key_type == KEY_TYPE_NORMAL and not service.restricted:
return True
# Revert back to the ORM model here so we can get some things which
# arent in the serialised model
service = dao_fetch_service_by_id(service.id)
team_members = itertools.chain.from_iterable(
[user.mobile_number, user.email_address] for user in service.users
)