Skip to content

Commit

Permalink
refactor: remove unused improt and rename S3Boto3Storage constructor …
Browse files Browse the repository at this point in the history
…param

refactor: match contructors

refactor: reviewer feedback changes
  • Loading branch information
ziafazal committed Jun 21, 2023
1 parent 6fef058 commit 18abe7a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions openedxscorm/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
from django.conf import settings

from django.core.files.storage import get_storage_class
from storages.backends.s3boto3 import S3Boto3Storage


Expand All @@ -13,12 +12,12 @@ class S3ScormStorage(S3Boto3Storage):
S3 backend for scorm metadata export
"""

def __init__(self, xblock, bucket, querystring_auth, querystring_expire):
def __init__(self, xblock, bucket_name=None, querystring_auth=None, querystring_expire=None):
self.xblock = xblock
# No need to serve assets from a custom domain.
self.custom_domain = None
super().__init__(
bucket=bucket,
bucket_name=bucket_name,
querystring_auth=querystring_auth,
querystring_expire=querystring_expire,
)
Expand Down Expand Up @@ -64,14 +63,14 @@ def s3(xblock):
Returns:
S3ScormStorage: An instance of the S3ScormStorage class.
"""
bucket = xblock.xblock_settings.get(
bucket_name = xblock.xblock_settings.get(
"S3_BUCKET_NAME", settings.AWS_STORAGE_BUCKET_NAME
)
querystring_auth = xblock.xblock_settings.get("S3_QUERY_AUTH", True)
querystring_expire = xblock.xblock_settings.get("S3_EXPIRES_IN", 604800)
return S3ScormStorage(
xblock=xblock,
bucket=bucket,
bucket_name=bucket_name,
querystring_auth=querystring_auth,
querystring_expire=querystring_expire,
)

0 comments on commit 18abe7a

Please sign in to comment.