Skip to content

Commit b21e2bb

Browse files
aclark4lifeCopilot
andauthored
Update django_mongodb_backend/schema.py
Co-authored-by: Copilot <[email protected]>
1 parent 6cb8b96 commit b21e2bb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

django_mongodb_backend/schema.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,10 @@ def _get_encrypted_fields_map(self, model, client, create_data_keys=False):
461461
auto_encryption_opts = options.auto_encryption_opts
462462
kms_provider = router.kms_provider(model)
463463
master_key = self.connection.settings_dict.get("KMS_CREDENTIALS", {}).get(kms_provider)
464+
if master_key is None:
465+
raise ImproperlyConfigured(
466+
f"KMS_CREDENTIALS for provider '{kms_provider}' not found in DATABASES['{self.connection.alias}']['KMS_CREDENTIALS']."
467+
)
464468
client_encryption = ClientEncryption(
465469
auto_encryption_opts._kms_providers,
466470
auto_encryption_opts._key_vault_namespace,

0 commit comments

Comments
 (0)