Skip to content

Commit e76fdcb

Browse files
authored
Add SQL query ordering in BackgroundChecks.py for list view
1 parent d28790a commit e76fdcb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

BackgroundChecks/BackgroundChecks.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,10 @@ def needs(r, p): # row, person
120120
model.Styles = "<style>.y { background: #dfd;} .n { background: #fdd; } .box-content a:not(.btn) {text-decoration: underline;}</style>"
121121

122122
adminMode = (model.Data.view == "admin" and userPerson.Users[0].InRole('Admin'))
123+
124+
sql = "{0} ORDER BY IIF(s.ActionRequired > GETDATE(), 1, 0), s.LastName".format(mainQuery)
123125

124-
for r in q.QuerySql(mainQuery):
126+
for r in q.QuerySql(sql):
125127

126128
cls = 'y' if not r.Status == "Invalid" else 'n'
127129

0 commit comments

Comments
 (0)