Skip to content

Commit

Permalink
imported flash and added flash to post_new_Cafe
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikerniker committed Feb 16, 2024
1 parent 67ede27 commit d0f5069
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Day88/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flask import Flask, render_template, jsonify, request, redirect, url_for
from flask import Flask, render_template, jsonify, request, redirect, url_for, flash
from flask_sqlalchemy import SQLAlchemy
import random
from forms import CafeForm
Expand Down Expand Up @@ -63,7 +63,8 @@ def post_new_cafe():
)
db.session.add(new_cafe)
db.session.commit()
print("Added new cafe")
flash("Added new cafe")
return redirect(url_for('post_new_cafe'))
return render_template('add_cafe.html', form=form)

@app.route("/delete/<int:cafe_id>")
Expand Down

0 comments on commit d0f5069

Please sign in to comment.