Skip to content
Snippets Groups Projects
Commit e6465b21 authored by Felix Chadwick-Smith's avatar Felix Chadwick-Smith
Browse files

Merge branch 'master' into 'main'

Master

See merge request !30
parents 1a239342 d7154073
Branches
No related tags found
1 merge request!30Master
No preview for this file type
For running ws
cd //c/Users//c2051326//Documents//Images
source venv/Scripts/activate
python -m flask run
No preview for this file type
......@@ -91,9 +91,8 @@ def download_cv():
@app.route('/download_assessment/<filename>')
def download_assessment(filename):
try:
file_path = os.path.join('static', filename)
file_path = os.path.join(app.static_folder, filename)
print(f"Attempting to serve file: {file_path}")
return send_from_directory(app.static_folder, filename, as_attachment=True)
except FileNotFoundError:
print(f"File not found: {file_path}")
......@@ -103,6 +102,7 @@ def download_assessment(filename):
current_app.logger.exception(f"Error serving assessment file: {str(e)}")
abort(500)
if __name__ == '__main__':
with app.app_context():
db.create_all()
......
......@@ -112,14 +112,12 @@
.then(response => response.json())
.then(data => {
console.log('Success:', data);
// Optionally, you can add code to show a success message to the user
// Reset the form
document.getElementById('contactForm').reset();
})
.catch((error) => {
console.error('Error:', error);
// Optionally, you can add code to show an error message to the user
});
});
</script>
......
......@@ -86,7 +86,7 @@
</html>`);
// Add style.css content
zip.file('style.css', `/* Your CSS styles go here */`);
zip.file('style.css', `/* CSS styles go here */`);
// Generate and initiate download
zip.generateAsync({ type: "blob" })
......
......@@ -41,15 +41,13 @@
<div class="assessment-links">
<ul>
<li><a href="{{ url_for('download_assessment', filename='c2051326_py.PDF') }}" target="_blank">CMT120 1a - PDF</a></li>
<li><a href="{{ url_for('download_assessment', filename='c2051326_js.PDF') }}" target="_blank">CMT120 1b - PDF</a></li>
<li><a href="{{ url_for('download_assessment', filename='c2051326_js.pdf') }}" target="_blank">CMT120 1b - PDF</a></li>
<li><a href="{{ url_for('download_assessment', filename='Team_12_Assessment_1.pptx') }}" target="_blank">CMT313 1a</a></li>
<li><a href="{{ url_for('download_assessment', filename='Risk_Register.PDF') }}" target="_blank">CMT313 1b - PDF</a></li>
<li><a href="{{ url_for('download_assessment', filename='User_Case_diagram.PDF') }}" target="_blank">CMT313 1c - PDF</a></li>
<li><a href="{{ url_for('download_assessment', filename='User_Case_diagram.pdf') }}" target="_blank">CMT313 1c - PDF</a></li>
</ul>
</div>
<a href="{{ url_for('download_cv') }}" class="btn btn2" download="my-cv.docx">Download CV</a>
</div>
</body>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment