diff --git a/files.py b/files.py index 58e3fce..3ec19cb 100644 --- a/files.py +++ b/files.py @@ -729,7 +729,12 @@ def view(id): # face locn data, just warn & redirect if id not in eids: print( f"ERROR: viewing an id, but its not in eids OPT={OPT}, id={id}, eids={eids}") - st.SetMessage("Sorry, viewing data is confused, cannot view this image now", "warning" ) + msg="Sorry, viewing data is confused, cannot view this image now" + if os.environ['FLASK_ENV'] == "production": + msg += "Clearing out all states. This means browser back buttons will not work, please start a new tab and try again" + PA_UserState.query.delete() + db.session.commit() + st.SetMessage( msg, "warning" ) return redirect("/") else: return render_template("viewer.html", current=int(id), eids=eids, objs=objs, OPT=OPT )