From c15d7b09c240b0c575dce6786ffb77c331817edc Mon Sep 17 00:00:00 2001 From: Josh Schneier Date: Sun, 8 Oct 2023 21:12:11 -0400 Subject: [PATCH] Revert "[s3] raise ImproperlyConfigured if no bucket name is set (#1313)" (#1322) This reverts commit 9eeb8c3dbc8874fe01532ccaa09700362805922c. --- storages/backends/s3.py | 2 -- tests/test_s3.py | 5 ----- 2 files changed, 7 deletions(-) diff --git a/storages/backends/s3.py b/storages/backends/s3.py index fdfc03d2..cf5dbe42 100644 --- a/storages/backends/s3.py +++ b/storages/backends/s3.py @@ -288,8 +288,6 @@ def __init__(self, **settings): super().__init__(**settings) check_location(self) - if not self.bucket_name: - raise ImproperlyConfigured("Setting a bucket name is required.") if (self.access_key or self.secret_key) and self.session_profile: raise ImproperlyConfigured( diff --git a/tests/test_s3.py b/tests/test_s3.py index d866d54b..629ace61 100644 --- a/tests/test_s3.py +++ b/tests/test_s3.py @@ -956,11 +956,6 @@ def test_auth_config(self): access_key="foo", secret_key="boo", session_profile="moo" ) - def test_bucket_name_required(self): - with override_settings(AWS_STORAGE_BUCKET_NAME=None): - with self.assertRaises(ImproperlyConfigured): - s3.S3Storage() - class S3StaticStorageTests(TestCase): def setUp(self):