1111
1212import logging
1313import os
14- import sys
1514from datetime import timedelta
1615from uuid import uuid4
1716
1817from django .conf import settings
1918from django .contrib import auth
20- from django .core .files .storage import FileSystemStorage
2119from django .db import DatabaseError , models , transaction
2220from django .db .models .signals import post_save , pre_save
2321from django .dispatch import Signal , receiver
2422from django .utils .timezone import now
2523from jsonfield import JSONField
2624from model_utils .models import TimeStampedModel
27- from storages .backends .s3boto3 import S3Boto3Storage
2825
2926from submissions .errors import DuplicateTeamSubmissionsError , TeamSubmissionInternalError , TeamSubmissionNotFoundError
3027
@@ -711,22 +708,6 @@ def submission_file_path(instance, _):
711708 )
712709
713710
714- # pylint: disable=abstract-method
715- class SubmissionFileStorage (S3Boto3Storage ):
716- """
717- Custom storage class for submission files that uses S3 in production with ORA bucket
718- and FileSystemStorage during tests.
719-
720- This class automatically detects test environments and changes behavior accordingly.
721- """
722- def __new__ (cls , * args , ** kwargs ):
723- if 'pytest' in sys .modules or any ('test' in arg for arg in sys .argv ):
724- return FileSystemStorage (* args , ** kwargs )
725- return super ().__new__ (cls ) # pragma: no cover
726-
727- bucket_name = getattr (settings , "FILE_UPLOAD_STORAGE_BUCKET_NAME" , "openedx" )
728-
729-
730711class SubmissionFile (models .Model ):
731712 """
732713 Model to handle files associated with submissions
@@ -741,7 +722,7 @@ class SubmissionFile(models.Model):
741722 file = models .FileField (
742723 upload_to = submission_file_path ,
743724 max_length = 512 ,
744- storage = SubmissionFileStorage ()
725+ # storage=SubmissionFileStorage()
745726 )
746727 original_filename = models .CharField (max_length = 255 ) # This is necessary to send file name to xqueue-watcher
747728 created_at = models .DateTimeField (default = now )
0 commit comments