Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
buzoghany requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerwoud committed Mar 20, 2024
1 parent bccda62 commit 2fd16a6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion backend/project/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
if __name__ == "__main__":
load_dotenv()
app = create_app_with_db(url)
app.run(debug=True, host='0.0.0.0', port=4000)
app.run(debug=True, host='0.0.0.0')
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ProjectAssignmentFiles(Resource):
Class for getting the assignment files of a project
"""

# @authorize_project_visible
@authorize_project_visible
def get(self, project_id):
"""
Get the assignment files of a project
Expand Down
18 changes: 11 additions & 7 deletions backend/project/endpoints/projects/project_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ def patch(self, project_id):
"""
project_json = parse_project_params()

output, status_code = patch_by_id_from_model(
Project,
"project_id",
project_id,
RESPONSE_URL,
project_json
)
if status_code != 200:
return output, status_code

if "assignment_file" in request.files:
file = request.files["assignment_file"]
filename = os.path.basename(file.filename)
Expand Down Expand Up @@ -81,13 +91,7 @@ def patch(self, project_id):
},
400)

return patch_by_id_from_model(
Project,
"project_id",
project_id,
RESPONSE_URL,
project_json
)
return output, status_code

@authorize_teacher_of_project
def delete(self, project_id):
Expand Down

0 comments on commit 2fd16a6

Please sign in to comment.