added BUG-120, somehow losing pref info. No prints are working in PROD, so changed a lot of printf( in the F/E to SetFELog with error and persistent/cant_close set across many files. Also used opportunity to remove a few unnecessary debugs

This commit is contained in:
2023-04-09 13:10:28 +10:00
parent cdef403187
commit a84ff49413
6 changed files with 40 additions and 23 deletions

View File

@@ -588,7 +588,7 @@ def view_list():
# this occurs when we went from the last image on a page (with how_many on
# it) and it just happened to also be the last in the DB...
if not entries:
print("DDP: DONT think this can happen anymore")
SetFELog( message="DDP: DONT think this can happen anymore", log_level="error", job=None, persistent=True, cant_close=True )
# undo the skip by how_many and getentries again
OPT.offset -= int(OPT.how_many)
@@ -676,7 +676,7 @@ def view(id):
eids=eids.rstrip(",")
# jic, sometimes we trip this, and rather than show broken pages / destroy
if id not in eids:
print( f"ERROR: viewing an id, but its not in eids OPT={OPT}, id={id}, eids={eids}")
SetFELog( message=f"ERROR: viewing an id, but its not in eids OPT={OPT}, id={id}, eids={eids}", log_level="error", persistent=True, cant_close=True)
msg="Sorry, viewing data is confused, cannot view this image now"
if os.environ['ENV'] == "production":
msg += "Clearing out all states. This means browser back buttons will not work, please start a new tab and try again"