diff --git a/backend/project/__main__.py b/backend/project/__main__.py index 32cb974f..444d1410 100644 --- a/backend/project/__main__.py +++ b/backend/project/__main__.py @@ -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') diff --git a/backend/project/endpoints/projects/project_assignment_file.py b/backend/project/endpoints/projects/project_assignment_file.py index ac66728d..88e12ac7 100644 --- a/backend/project/endpoints/projects/project_assignment_file.py +++ b/backend/project/endpoints/projects/project_assignment_file.py @@ -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 diff --git a/backend/project/endpoints/projects/project_detail.py b/backend/project/endpoints/projects/project_detail.py index c945ac60..153dbb66 100644 --- a/backend/project/endpoints/projects/project_detail.py +++ b/backend/project/endpoints/projects/project_detail.py @@ -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) @@ -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):