Skip to content

Commit c603cfe

Browse files
committed
Uncommented the slackbot ping
1 parent 86a2060 commit c603cfe

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

conditional/blueprints/major_project_submission.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ def display_major_project(user_dict=None):
8383
aws_secret_access_key=app.config['AWS_SECRET_ACCESS_KEY'],
8484
endpoint_url=app.config['S3_URI']
8585
)
86+
87+
bucket = app.config['S3_BUCKET_ID']
8688

8789
major_projects = [
8890
{
@@ -98,7 +100,7 @@ def display_major_project(user_dict=None):
98100
"links": list(filter(None, p.links.split("\n"))),
99101
"status": p.status,
100102
"is_owner": bool(user_dict["username"] == p.uid),
101-
"files": list_files_in_folder("major-project-media", f"{p.id}/")
103+
"files": list_files_in_folder(bucket, f"{p.id}/")
102104
}
103105
for p in proj_list
104106
]
@@ -118,8 +120,6 @@ def upload_major_project_files(user_dict=None):
118120
log = logger.new(request=request, auth_dict=user_dict)
119121
log.info('Uploading Major Project File(s)')
120122

121-
# log.info(f"user_dict: {user_dict}")
122-
123123
if len(list(request.files.keys())) <1:
124124
return "No file", 400
125125

@@ -146,8 +146,6 @@ def submit_major_project(user_dict=None):
146146

147147
post_data = request.get_json()
148148

149-
print(f"Post Data: {post_data}") # TODO: Remove this later
150-
151149
name = post_data["projectName"]
152150
tldr = post_data['projectTldr']
153151
time_spent = post_data['projectTimeSpent']
@@ -164,8 +162,7 @@ def submit_major_project(user_dict=None):
164162
if not name or not tldr or not time_spent or not description:
165163
return jsonify({"success": False}), 400
166164

167-
# TODO: Ensure all the information is being passed to the object
168-
project = MajorProject(user_id, name, tldr, time_spent, description, links)
165+
project: MajorProject = MajorProject(user_id, name, tldr, time_spent, description, links)
169166

170167
# Save the info to the database
171168
db.session.add(project)
@@ -178,8 +175,7 @@ def submit_major_project(user_dict=None):
178175
MajorProject.uid == user_id
179176
).first()
180177

181-
skills_list = list(filter(lambda x: x != 'None', skills))
182-
print(f"Skills: {list(skills_list)}")
178+
skills_list: list = list(filter(lambda x: x != 'None', skills))
183179

184180
for skill in skills_list:
185181
skill = skill.strip()
@@ -219,12 +215,12 @@ def submit_major_project(user_dict=None):
219215

220216
# Send the slack ping only after we know that the data was properly saved to the DB
221217
# TODO: Maybe add more info to the slack ping?
222-
# send_slack_ping(
223-
# {
224-
# "text": f"<!subteam^S5XENJJAH> *{get_member_name(user_id)}* ({user_id})"
225-
# f" submitted their major project, *{name}*!"
226-
# }
227-
# )
218+
send_slack_ping(
219+
{
220+
"text": f"<!subteam^S5XENJJAH> *{get_member_name(user_id)}* ({user_id})"
221+
f" submitted their major project, *{name}*!"
222+
}
223+
)
228224

229225
return jsonify({"success": True}), 200
230226

0 commit comments

Comments
 (0)