From acd47f44f0fd5e55ef10d4d6057ec31e75e706d9 Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Wed, 24 Apr 2019 15:37:40 +0100 Subject: [PATCH 1/2] We want to continue not break. --- app/commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/commands.py b/app/commands.py index 4a85675b4..304a3e73f 100644 --- a/app/commands.py +++ b/app/commands.py @@ -830,12 +830,12 @@ def populate_go_live(file_name): go_live_user = get_user_by_email(go_live_email) except NoResultFound: print("No user found for email address: ", go_live_email) - break + continue try: service = dao_fetch_service_by_id(service_id) except NoResultFound: print("No service found for: ", service_id) - break + continue service.go_live_user = go_live_user service.go_live_at = go_live_date dao_update_service(service) From 059bd52ee9332c6417a83e774a72f2dbc32a2e5d Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Wed, 24 Apr 2019 15:44:57 +0100 Subject: [PATCH 2/2] Leave go live user empty if it's not populated in spreadsheet --- app/commands.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/commands.py b/app/commands.py index 304a3e73f..2a2cee9f6 100644 --- a/app/commands.py +++ b/app/commands.py @@ -827,7 +827,10 @@ def populate_go_live(file_name): go_live_date = datetime.strptime(row[8], '%d/%m/%Y') + timedelta(hours=12) print(service_id, go_live_email, go_live_date) try: - go_live_user = get_user_by_email(go_live_email) + if go_live_email: + go_live_user = get_user_by_email(go_live_email) + else: + go_live_user = None except NoResultFound: print("No user found for email address: ", go_live_email) continue