File tree 1 file changed +6
-7
lines changed 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -364,26 +364,25 @@ def get_setting(name: str, default=_NoValue) -> T.Any:
364
364
365
365
366
366
def create_minio_client_from_settings (* , minio_kwargs = None ):
367
- kwargs = {}
368
367
endpoint = get_setting ("MINIO_STORAGE_ENDPOINT" )
369
- access_key = get_setting ("MINIO_STORAGE_ACCESS_KEY" )
370
- secret_key = get_setting ("MINIO_STORAGE_SECRET_KEY" )
371
- secure = get_setting ("MINIO_STORAGE_USE_HTTPS" , True )
368
+ kwargs = {
369
+ "access_key" : get_setting ("MINIO_STORAGE_ACCESS_KEY" ),
370
+ "secret_key" : get_setting ("MINIO_STORAGE_SECRET_KEY" ),
371
+ "secure" : get_setting ("MINIO_STORAGE_USE_HTTPS" , True ),
372
+ }
372
373
region = get_setting ("MINIO_STORAGE_REGION" , None )
373
374
if region :
374
375
kwargs ["region" ] = region
375
376
376
377
if minio_kwargs :
377
378
kwargs .update (minio_kwargs )
379
+
378
380
# Making this client deconstructible allows it to be passed directly as
379
381
# an argument to MinioStorage, since Django needs to be able to
380
382
# deconstruct all Storage constructor arguments for Storages referenced in
381
383
# migrations (e.g. when using a custom storage on a FileField).
382
384
client = deconstructible (minio .Minio )(
383
385
endpoint ,
384
- access_key = access_key ,
385
- secret_key = secret_key ,
386
- secure = secure ,
387
386
** kwargs ,
388
387
)
389
388
return client
You can’t perform that action at this time.
0 commit comments