chore: (#9089 followup) fix storage factory constructor (#9609)

This commit is contained in:
Bowen Liang 2024-10-22 13:01:37 +08:00 committed by GitHub
parent 4d9160ca9f
commit d170d78530
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 6 deletions

View File

@ -4,7 +4,6 @@ from collections.abc import Generator
import boto3
from botocore.client import Config
from botocore.exceptions import ClientError
from flask import Flask
from extensions.storage.base_storage import BaseStorage
@ -14,8 +13,8 @@ logger = logging.getLogger(__name__)
class AwsS3Storage(BaseStorage):
"""Implementation for Amazon Web Services S3 storage."""
def __init__(self, app: Flask):
super().__init__(app)
def __init__(self):
super().__init__()
app_config = self.app.config
self.bucket_name = app_config.get("S3_BUCKET_NAME")
if app_config.get("S3_USE_AWS_MANAGED_IAM"):

View File

@ -2,7 +2,6 @@ import io
from collections.abc import Generator
from pathlib import Path
from flask import Flask
from supabase import Client
from extensions.storage.base_storage import BaseStorage
@ -11,8 +10,8 @@ from extensions.storage.base_storage import BaseStorage
class SupabaseStorage(BaseStorage):
"""Implementation for supabase obs storage."""
def __init__(self, app: Flask):
super().__init__(app)
def __init__(self):
super().__init__()
app_config = self.app.config
self.bucket_name = app_config.get("SUPABASE_BUCKET_NAME")
self.client = Client(