Merge pull request #2472 from alphagov/fix-populate-go-live

Fix command to populate go live data
This commit is contained in:
Rebecca Law
2019-04-24 16:04:36 +01:00
committed by GitHub

View File

@@ -827,15 +827,18 @@ 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)
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)