fixed BUG-126, so removing debugs, changing unlikely bug reoccurrence to a warning that can be closed

This commit is contained in:
2024-06-29 13:51:53 +10:00
parent d7f028f3d1
commit 1277558b0e

View File

@@ -59,7 +59,6 @@ class States(PA):
self.last_eid=0 self.last_eid=0
self.num_entries=0 self.num_entries=0
print("BUG-DEBUG: States() called view_eid reset to None")
# this is any next/prev or noo, grouping, etc. change (so use referrer to work out what to do with this) # this is any next/prev or noo, grouping, etc. change (so use referrer to work out what to do with this)
# because this can happen on a view, or files_up, etc. change this FIRST # because this can happen on a view, or files_up, etc. change this FIRST
if 'change_file_opts' in request.path: if 'change_file_opts' in request.path:
@@ -71,13 +70,11 @@ class States(PA):
if 'view_list' in request.path: if 'view_list' in request.path:
self.path_type = 'View' self.path_type = 'View'
self.view_eid = request.form['view_eid'] self.view_eid = request.form['view_eid']
print(f"BUG-DEBUG: States() called view_eid set as 'view_list' in request.path - {self.view_eid}")
self.url = request.form['orig_url'] self.url = request.form['orig_url']
# this occurs ONLY when a POST to /view/<id> occurs (at this stage orig_url will be from an import, storage, bin or search) # this occurs ONLY when a POST to /view/<id> occurs (at this stage orig_url will be from an import, storage, bin or search)
elif 'view' in request.path: elif 'view' in request.path:
self.path_type = 'View' self.path_type = 'View'
self.view_eid = self.url[6:] self.view_eid = self.url[6:]
print(f"BUG-DEBUG: States() called view_eid set as 'view' in request.path - {self.view_eid}")
# use orig url to define defaults/look up states for 'last' import/storage/bin/search # use orig url to define defaults/look up states for 'last' import/storage/bin/search
if request.method == "POST": if request.method == "POST":
self.url = request.form['orig_url'] self.url = request.form['orig_url']
@@ -129,7 +126,6 @@ class States(PA):
# use url to get eid of viewed entry # use url to get eid of viewed entry
self.view_eid = self.url[6:] self.view_eid = self.url[6:]
print(f"BUG-DEBUG: States() called 'view' in self.url view_eid={self.view_eid}")
# force this to be a search so rest of code won't totally die, but also not return anything # force this to be a search so rest of code won't totally die, but also not return anything
self.path_type="Search" self.path_type="Search"
self.orig_url=self.url self.orig_url=self.url
@@ -168,7 +164,6 @@ class States(PA):
self.orig_search_term=pref.orig_search_term self.orig_search_term=pref.orig_search_term
self.orig_url = pref.orig_url self.orig_url = pref.orig_url
self.view_eid = pref.view_eid self.view_eid = pref.view_eid
print(f"BUG-DEBUG: view_eid based on prefs- {self.view_eid}")
self.current = pref.current self.current = pref.current
if self.path_type == "View": if self.path_type == "View":
self.root='static/' + self.orig_ptype self.root='static/' + self.orig_ptype
@@ -269,8 +264,7 @@ class States(PA):
self.offset += int(self.how_many) self.offset += int(self.how_many)
else: else:
# should be impossible now, but leave jic # should be impossible now, but leave jic
SetFELog( message=f"WARNING: next image requested, but would go past end of list? - ignore this" , level="warning", persistent=True, cant_close=True ) SetFELog( message=f"WARNING: next image requested, but would go past end of list? - ignore this" , level="warning", persistent=True, cant_close=False )
SetFELog( message=f"DDP - offset={self.offset} + how_many={self.how_many} > num_entries={self.num_entries}" , level="danger", persistent=True, cant_close=True )
if 'current' in request.form: if 'current' in request.form:
self.current = int(request.form['current']) self.current = int(request.form['current'])
@@ -282,13 +276,11 @@ class States(PA):
noo=self.noo, grouping=self.grouping, how_many=self.how_many, st_offset=self.offset, size=self.size, noo=self.noo, grouping=self.grouping, how_many=self.how_many, st_offset=self.offset, size=self.size,
folders=self.folders, root=self.root, cwd=self.cwd, orig_ptype=self.orig_ptype, orig_search_term=self.orig_search_term, folders=self.folders, root=self.root, cwd=self.cwd, orig_ptype=self.orig_ptype, orig_search_term=self.orig_search_term,
orig_url=self.orig_url, current=self.current, first_eid=self.first_eid, last_eid=self.last_eid, num_entries=self.num_entries ) orig_url=self.orig_url, current=self.current, first_eid=self.first_eid, last_eid=self.last_eid, num_entries=self.num_entries )
print( f"BUG-DEBUG: prefs SET based on self, view_eid={self.view_eid}")
else: else:
# update this pref with the values calculated above (most likely from POST to form) # update this pref with the values calculated above (most likely from POST to form)
pref.pa_user_dn=current_user.dn pref.pa_user_dn=current_user.dn
pref.path_type=self.path_type pref.path_type=self.path_type
pref.view_eid=self.view_eid pref.view_eid=self.view_eid
print( f"BUG-DEBUG: prefs UPDATED based on self, view_eid={self.view_eid}")
pref.noo=self.noo pref.noo=self.noo
pref.grouping=self.grouping pref.grouping=self.grouping
pref.how_many=self.how_many pref.how_many=self.how_many