renamed ClearMessage to better name of ClearStatus, and exposed it to jinja2 so status messages now work in base.html

This commit is contained in:
2021-01-10 12:17:14 +11:00
parent 7a0d9ec165
commit 0bbed0ced5
2 changed files with 7 additions and 1 deletions

View File

@@ -26,6 +26,12 @@ db = SQLAlchemy(app)
ma = Marshmallow(app)
Bootstrap(app)
####################################### GLOBALS #######################################
# allow jinja2 to call these python functions directly
app.jinja_env.globals['ClearStatus'] = st.ClearStatus
@app.route("/test", methods=["GET"])
def test():
return render_template("base.html", alert=st.GetAlert(), message=st.GetMessage())

View File

@@ -21,7 +21,7 @@ class Status:
self.message=self.message+msg
return
def ClearMessage(self):
def ClearStatus(self):
self.alert="success"
self.message=""
return ""