adding extra debugs for weird bugs with losing data when viewing

This commit is contained in:
2024-04-07 20:18:40 +10:00
parent fed78672dc
commit 4885acea80
2 changed files with 13 additions and 0 deletions

View File

@@ -641,9 +641,12 @@ def view_list():
resp['last_eid']=OPT.last_eid
resp['eids']=eids
resp['offset']=OPT.offset
print( f"BUG-DEBUG: /view_list route #1 - OPT={OPT}, eids={eids} ")
# save pref to keep the new current value, first/last
pref=PA_UserState.query.filter(PA_UserState.pa_user_dn==current_user.dn,PA_UserState.orig_ptype==OPT.orig_ptype,PA_UserState.view_eid==OPT.view_eid).first()
print( f"BUG-DEBUG: /view_list route #2 - OPT={OPT}, eids={eids} ")
UpdatePref( pref, OPT )
print( f"BUG-DEBUG: /view_list route #3 - OPT={OPT}, eids={eids} ")
return make_response( resp )
@@ -691,6 +694,7 @@ def view(id):
imp_path = setting.import_path
st_path = setting.storage_path
bin_path = setting.recycle_bin_path
print( f"BUG-DEBUG: /view/id GET route - OPT={OPT}, eids={eids}, current={int(id)} ")
return render_template("viewer.html", current=int(id), eids=eids, objs=objs, OPT=OPT, NMO_data=NMO_data, imp_path=imp_path, st_path=st_path, bin_path=bin_path )
##################################################################################
@@ -701,6 +705,7 @@ def view(id):
def view_img_post(id):
# set pa_user_states...
OPT=States( request )
print( f"BUG-DEBUG: /view/id POST route - OPT={OPT}, id={id} ")
# then use back-button friendly URL (and use pa_user_states to view the right image in the right list
return redirect( "/view/" + id );