diff --git a/main.py b/main.py index 1a8fa15..fdfd7e4 100644 --- a/main.py +++ b/main.py @@ -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()) diff --git a/status.py b/status.py index b0c30f4..ca6f9df 100644 --- a/status.py +++ b/status.py @@ -21,7 +21,7 @@ class Status: self.message=self.message+msg return - def ClearMessage(self): + def ClearStatus(self): self.alert="success" self.message="" return ""