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

modified the add_project route in your Flask application to include flash...

 modified the add_project route in your Flask application to include flash messages upon successful submission of the project form and redirected to the home page.
parent 18362cdc
No related branches found
No related tags found
1 merge request!24modified the add_project route in your Flask application to include flash...
...@@ -67,11 +67,11 @@ def add_project(): ...@@ -67,11 +67,11 @@ def add_project():
new_project = Project(title=title, description=description) new_project = Project(title=title, description=description)
db.session.add(new_project) db.session.add(new_project)
db.session.commit() db.session.commit()
return redirect(url_for('Home'))
return render_template('add_project.html', form=form) # Pass the form to the template
flash('Project added successfully!', 'success') # Flash success message
return redirect(url_for('home'))
return render_template('add_project.html', form=form)
# Updated route for serving the 'my-cv.docx' file # Updated route for serving the 'my-cv.docx' file
@app.route('/download_cv') @app.route('/download_cv')
def download_cv(): def download_cv():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment