From 2298e757b7fc95bf91c35d1e2f5942a4b6cd3aef Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Sat, 15 Dec 2012 15:15:33 -0500 Subject: simplified check of the sorting column --- GradeBook_lib.tcl | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'GradeBook_lib.tcl') diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl index f94f165..dd0d3e1 100755 --- a/GradeBook_lib.tcl +++ b/GradeBook_lib.tcl @@ -695,15 +695,8 @@ proc htmlDBout {db permission_list user {sort_col {}}} { set grades_category [ get_grades_category ] set defSortCol LastName - if { $sort_col == {} } { - set sort_col $defSortCol - dbg "empty sort col changed to $sort_col" msg_level_info - } # testing for the existence of the sorting column - set eval_str [concat SELECT * FROM GradesTable ORDER BY \"$sort_col\"] - set err [catch {db eval $eval_str } errStat] - if { $err } { - dbg $errStat msg_level_info + if { ![doesColumnExists $sort_col GradesTable] } { dbg "changing to default sorting column $defSortCol" msg_level_info set sort_col $defSortCol } -- cgit v1.2.3