From fff26e61e0f39491215e3c2ba3038d8dc7857e53 Mon Sep 17 00:00:00 2001 From: Kristof Daja Date: Sat, 6 Nov 2021 16:33:04 +0100 Subject: [PATCH] Addition to for #31 The value detection of "MINIO_USE_HTTPS" was faulty. False values were treated incorrectly. --- django_minio_backend/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/django_minio_backend/models.py b/django_minio_backend/models.py index 52f5065..9223e0f 100644 --- a/django_minio_backend/models.py +++ b/django_minio_backend/models.py @@ -419,7 +419,7 @@ def validate_settings(self): """ validate_settings raises a ConfigurationError exception when one of the following conditions is met: * Neither MINIO_PRIVATE_BUCKETS nor MINIO_PUBLIC_BUCKETS have been declared and configured with at least 1 bucket - * A mandatory parameter (ENDPOINT, ACCESS_KEY or SECRET_KEY) hasn't been declared and configured properly + * A mandatory parameter (ENDPOINT, ACCESS_KEY, SECRET_KEY or USE_HTTP) hasn't been declared and configured properly """ # minimum 1 bucket has to be declared if not (get_setting("MINIO_PRIVATE_BUCKETS") or get_setting("MINIO_PUBLIC_BUCKETS")): @@ -432,9 +432,9 @@ def validate_settings(self): ) # mandatory parameters must be configured mandatory_parameters = (self.__MINIO_ENDPOINT, self.__MINIO_ACCESS_KEY, self.__MINIO_SECRET_KEY) - if any([bool(x) is False for x in mandatory_parameters]): + if any([bool(x) is False for x in mandatory_parameters]) or (get_setting("MINIO_USE_HTTPS") is None): raise ConfigurationError( - "A mandatory parameter (ENDPOINT, ACCESS_KEY, or SECRET_KEY) hasn't been configured properly" + "A mandatory parameter (MINIO_ENDPOINT, MINIO_ACCESS_KEY, MINIO_SECRET_KEY or MINIO_USE_HTTPS) hasn't been configured properly" )