From 6c415df11314e4f5472debd6b758b2cbcd9fb1b5 Mon Sep 17 00:00:00 2001 From: Vincent Renaville Date: Fri, 1 Apr 2022 11:08:13 +0200 Subject: [PATCH] fix: be sure parameter is set in the dict (#358) --- attachment_s3/models/ir_attachment.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/attachment_s3/models/ir_attachment.py b/attachment_s3/models/ir_attachment.py index dd058b0..44b02c2 100644 --- a/attachment_s3/models/ir_attachment.py +++ b/attachment_s3/models/ir_attachment.py @@ -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'