From 8ccddefd060636228ed3f24494e002157445fa46 Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Wed, 17 Apr 2019 14:46:04 +0200 Subject: [PATCH] Fix use of aws where hostname is not required This fixes an error with endpoint computed as https://None while we want to let boto compute the AWS endpoint --- attachment_s3/models/ir_attachment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attachment_s3/models/ir_attachment.py b/attachment_s3/models/ir_attachment.py index 82befae..09c357d 100644 --- a/attachment_s3/models/ir_attachment.py +++ b/attachment_s3/models/ir_attachment.py @@ -49,7 +49,7 @@ class IrAttachment(models.Model): host = os.environ.get('AWS_HOST') # Ensure host is prefixed with a scheme (use https as default) - if not urlsplit(host).scheme: + if host and not urlsplit(host).scheme: host = 'https://%s' % host region_name = os.environ.get('AWS_REGION')