From e293e98ac350d42190a9f4b7dcc4b53129ee16e5 Mon Sep 17 00:00:00 2001 From: Tessa Walsh Date: Mon, 27 Mar 2023 16:52:05 -0400 Subject: [PATCH] Fix migration to avoid jobType KeyError (#727) * Fix migration to avoid KeyError * Use .get() for other optional fields --- .../migrations/migration_0003_mutable_crawl_configs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/btrixcloud/migrations/migration_0003_mutable_crawl_configs.py b/backend/btrixcloud/migrations/migration_0003_mutable_crawl_configs.py index 04d6a656..e0369051 100644 --- a/backend/btrixcloud/migrations/migration_0003_mutable_crawl_configs.py +++ b/backend/btrixcloud/migrations/migration_0003_mutable_crawl_configs.py @@ -63,10 +63,10 @@ class Migration(BaseMigration): { "$set": { "config": config_result["config"], - "profileid": config_result["profileid"], - "schedule": config_result["schedule"], - "crawlTimeout": config_result["crawlTimeout"], - "jobType": config_result["jobType"], + "profileid": config_result.get("profileid"), + "schedule": config_result.get("schedule"), + "crawlTimeout": config_result.get("crawlTimeout"), + "jobType": config_result.get("jobType"), } }, )