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

Merge branch 'master' into 'main'

added in flash messages for submitting project

See merge request !23
parents 51be9ade 18362cdc
No related branches found
No related tags found
1 merge request!23added in flash messages for submitting project
......@@ -67,7 +67,7 @@ def add_project():
new_project = Project(title=title, description=description)
db.session.add(new_project)
db.session.commit()
return redirect(url_for('home'))
return redirect(url_for('Home'))
return render_template('add_project.html', form=form) # Pass the form to the template
......
......@@ -21,6 +21,15 @@
</nav>
<h2>Add Project</h2>
<form method="POST" action="{{ url_for('add_project') }}">
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul class="messages">
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
{% if form %}
{{ form.csrf_token }}
<div class="form-group">
......
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