Skip to content
Snippets Groups Projects

Master

Merged Felix Chadwick-Smith requested to merge master into main
1 file
+ 4
4
Compare changes
  • Side-by-side
  • Inline
+ 4
4
@@ -76,9 +76,10 @@ def download_cv():
@app.route('/download_assessment/<filename>')
def download_assessment(filename):
try:
file_path = f'static/{filename}'
file_path = os.path.join('static', filename)
print(f"Attempting to serve file: {file_path}")
return send_from_directory('static', filename, as_attachment=True)
return send_from_directory(app.static_folder, filename, as_attachment=True)
except FileNotFoundError:
print(f"File not found: {file_path}")
abort(404) # Return a 404 Not Found error
@@ -86,8 +87,7 @@ def download_assessment(filename):
print(f"Error serving assessment file: {str(e)}")
current_app.logger.exception(f"Error serving assessment file: {str(e)}")
abort(500)
if __name__ == '__main__':
with app.app_context():
db.create_all()
Loading