From 864dfaa9bc3b1cfe745acc73e5df7d28533229ad Mon Sep 17 00:00:00 2001 From: Abhimanyu Saharan Date: Tue, 2 Nov 2021 07:57:51 -0700 Subject: [PATCH 1/2] Fixed validate settings --- 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 55f25cf..8de6e86 100644 --- a/django_minio_backend/models.py +++ b/django_minio_backend/models.py @@ -89,7 +89,7 @@ def __init__(self, self.__MINIO_EXTERNAL_ENDPOINT: str = get_setting("MINIO_EXTERNAL_ENDPOINT", self.__MINIO_ENDPOINT) self.__MINIO_ACCESS_KEY: str = get_setting("MINIO_ACCESS_KEY") self.__MINIO_SECRET_KEY: str = get_setting("MINIO_SECRET_KEY") - self.__MINIO_USE_HTTPS: bool = get_setting("MINIO_USE_HTTPS") + self.__MINIO_USE_HTTPS: bool = get_setting("MINIO_USE_HTTPS", False) self.__MINIO_EXTERNAL_ENDPOINT_USE_HTTPS: bool = get_setting("MINIO_EXTERNAL_ENDPOINT_USE_HTTPS", self.__MINIO_USE_HTTPS) self.__MINIO_BUCKET_CHECK_ON_SAVE: bool = get_setting("MINIO_BUCKET_CHECK_ON_SAVE", False) @@ -431,10 +431,10 @@ def validate_settings(self): 'must be configured in your settings.py (can be both)' ) # mandatory parameters must be configured - mandatory_parameters = (self.__MINIO_ENDPOINT, self.__MINIO_ACCESS_KEY, self.__MINIO_SECRET_KEY, self.__MINIO_USE_HTTPS) + mandatory_parameters = (self.__MINIO_ENDPOINT, self.__MINIO_ACCESS_KEY, self.__MINIO_SECRET_KEY) if any([bool(x) is False for x in mandatory_parameters]): raise ConfigurationError( - "A mandatory parameter (ENDPOINT, ACCESS_KEY, SECRET_KEY or USE_HTTP) hasn't been configured properly" + "A mandatory parameter (ENDPOINT, ACCESS_KEY, or SECRET_KEY) hasn't been configured properly" ) From 8a474149a613a0a94eef3944eb72f3ff89b46ec9 Mon Sep 17 00:00:00 2001 From: Abhimanyu Saharan Date: Tue, 2 Nov 2021 08:02:46 -0700 Subject: [PATCH 2/2] Fixed comment --- django_minio_backend/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_minio_backend/models.py b/django_minio_backend/models.py index 8de6e86..52f5065 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, SECRET_KEY or USE_HTTP) hasn't been declared and configured properly + * A mandatory parameter (ENDPOINT, ACCESS_KEY or SECRET_KEY) 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")):