Fix migration to avoid jobType KeyError (#727)

* Fix migration to avoid KeyError

* Use .get() for other optional fields
This commit is contained in:
Tessa Walsh 2023-03-27 16:52:05 -04:00 committed by GitHub
parent bca67c74e2
commit e293e98ac3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"),
}
},
)