fixed bug when get of a view is for a non-search, now that I have added search to pa_user_state ORM query

This commit is contained in:
2022-02-03 21:16:51 +11:00
parent e1a6348967
commit e16f7dbc30
2 changed files with 10 additions and 11 deletions

View File

@@ -83,8 +83,13 @@ class States(PA):
# GET's occur on redirect, and we don't have a form, so get it from pref
st=self.url[8:]
ref=request.referrer
st=re.sub( '.+/search/', '', ref )
if 'search' in ref:
st=re.sub( '.+/search/', '', ref )
else:
st=''
pref=PA_UserState.query.filter(PA_UserState.pa_user_dn==current_user.dn,PA_UserState.path_type==self.path_type,PA_UserState.view_eid==self.view_eid,PA_UserState.orig_search_term==st).first()
if not pref:
print( f"pref not found dn={current_user.dn}, st={st}, s={self}????" )
self.url = pref.orig_url
if 'files_ip' in self.url or 'file_list_ip' in self.url: