broad (small) changes to make style of all routes and jobs to be consistent, e.g. use underscords between words
This commit is contained in:
16
states.py
16
states.py
@@ -60,14 +60,14 @@ class States(PA):
|
||||
|
||||
# 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
|
||||
if 'ChangeFileOpts' in request.path:
|
||||
if 'change_file_opts' in request.path:
|
||||
ref=request.referrer
|
||||
base=request.base_url
|
||||
base=base.replace("ChangeFileOpts", "")
|
||||
base=base.replace("change_file_opts", "")
|
||||
self.url = "/"+ref.replace(base, "" )
|
||||
|
||||
# if viewlist, then we really are a view, and view_eid should be in the form
|
||||
if 'viewlist' in request.path:
|
||||
# if view_list, then we really are a view, and view_eid should be in the form
|
||||
if 'view_list' in request.path:
|
||||
self.path_type = 'View'
|
||||
self.view_eid = request.form['view_eid']
|
||||
self.url = request.form['orig_url']
|
||||
@@ -122,7 +122,7 @@ class States(PA):
|
||||
self.view_eid = self.url[6:]
|
||||
self.path_type="View"
|
||||
self.orig_url=self.url
|
||||
elif 'ChangeFileOpts' not in self.url:
|
||||
elif 'change_file_opts' not in self.url:
|
||||
print( f"ERROR: DDP messed up, failed to match URL {self.url} for settings this will fail, redirecting to home" )
|
||||
print( f"referrer={request.referrer}" )
|
||||
return
|
||||
@@ -205,7 +205,7 @@ class States(PA):
|
||||
if request.method=="POST":
|
||||
if self.path_type != "View" and 'noo' in request.form:
|
||||
# we are changing values based on a POST to the form, if we changed the noo option, we need to reset things
|
||||
if 'ChangeFileOpts' in request.path and self.noo != request.form['noo']:
|
||||
if 'change_file_opts' in request.path and self.noo != request.form['noo']:
|
||||
self.noo=request.form['noo']
|
||||
self.first_eid=0
|
||||
self.last_eid=0
|
||||
@@ -222,7 +222,7 @@ class States(PA):
|
||||
# seems html cant do boolean, but uses strings so convert
|
||||
if self.path_type != "View" and 'folders' in request.form:
|
||||
# we are changing values based on a POST to the form, if we are in folder view and we changed the folders option, we need to reset things
|
||||
if 'ChangeFileOpts' in request.path:
|
||||
if 'change_file_opts' in request.path:
|
||||
if self.folders and self.folders != request.form['folders']:
|
||||
self.num_entries=0
|
||||
self.first_eid=0
|
||||
@@ -283,7 +283,7 @@ class States(PA):
|
||||
pref.first_eid = self.first_eid
|
||||
pref.last_eid = self.last_eid
|
||||
pref.num_entries = self.num_entries
|
||||
# only passed in (at the moment) in viewlist
|
||||
# only passed in (at the moment) in view_list
|
||||
pref.current = self.current
|
||||
|
||||
db.session.add(pref)
|
||||
|
||||
Reference in New Issue
Block a user