Skip to content

Commit b9a2f33

Browse files
committed
s3 endpoint added
1 parent 2f42078 commit b9a2f33

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

conditional/blueprints/major_project_submission.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ def upload_major_project_files(user_dict=None):
6565
log = logger.new(request=request, auth_dict=user_dict)
6666
log.info('Uploading Major Project File(s)')
6767

68-
print(request.files)
6968
if len(list(request.files.keys())) < 1:
7069
return "No file", 400
7170

@@ -79,6 +78,9 @@ def upload_major_project_files(user_dict=None):
7978
os.makedirs(os.path.dirname(filename), exist_ok=True)
8079
file.save(filename)
8180

81+
return jsonify({"success": True}), 200
82+
83+
8284

8385
@major_project_bp.route('/major_project/submit', methods=['POST'])
8486
@auth.oidc_auth
@@ -91,12 +93,12 @@ def submit_major_project(user_dict=None):
9193
name = post_data['projectName']
9294
description = post_data['projectDescription']
9395

94-
if name == "" or len(description.strip().split()) < 50:
96+
if name == "" or len(description.strip().split()) < 50: # check for 50 word minimum
9597
return jsonify({"success": False}), 400
9698
project = MajorProject(user_dict['username'], name, description)
9799

98100
# Acquire S3 Bucket instance
99-
s3 = boto3.resource("s3")
101+
s3 = boto3.resource("s3", endpoint_url="https://s3.csh.rit.edu")
100102
bucket = s3.create_bucket(Bucket="major-project-media")
101103
# Collect all the locally cached files and put them in the bucket
102104
for file in os.listdir(f"/tmp/{user_dict['username']}"):

0 commit comments

Comments
 (0)