fix: be sure parameter is set in the dict (#358)

This commit is contained in:
Vincent Renaville
2022-04-01 11:08:13 +02:00
committed by GitHub
co-authored by GitHub
parent 1f5970f05e
commit 6c415df113
+3 -3
View File
@@ -96,9 +96,9 @@ class IrAttachment(models.Model):
bucket_name = params.pop("bucket_name")
if not (
bucket_name and
(params["aws_access_key_id"] and
params["aws_secret_access_key"] or
params["aws_use_irsa"])
(params.get("aws_access_key_id") and
params.get("aws_secret_access_key") or
params.get("aws_use_irsa"))
):
msg = _('If you want to read from the %s S3 bucket, the following '
'environment variables must be set:\n'