summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-01-10 02:08:26 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2011-01-10 02:08:26 -0500
commitabb327189690078680d5402696538891074b08b8 (patch)
tree0dbfee9bb53e485ccc9accc8256eae2efd911978
parent297ea8435e15d772aa1dbf22e07b3230b665f5e2 (diff)
downloadGradeBook-abb327189690078680d5402696538891074b08b8.tar.gz
GradeBook-abb327189690078680d5402696538891074b08b8.zip
check that only requested columns are updated
Ignore-this: 54037febe6645f2dc7a70143f5c121da darcs-hash:20110110070826-067c0-2ead3a82dd9639362a552d1de9e15eafe50776a9.gz
-rwxr-xr-xGradeBook.tcl18
1 files changed, 10 insertions, 8 deletions
diff --git a/GradeBook.tcl b/GradeBook.tcl
index 85aa716..ff93ef1 100755
--- a/GradeBook.tcl
+++ b/GradeBook.tcl
@@ -299,14 +299,16 @@ proc UpdateGrades { permission_list user } {
set eval_str "SELECT UserName FROM GradesTable"
set err [catch {
db eval $eval_str v {
- set sql_str [concat UPDATE GradesTable SET \"$columnname\"=\'$colval($v(UserName))\' where UserName=\"$v(UserName)\"]
- set err2 [catch {
- db eval $sql_str
- } errStat2 ]
- if { $err2 } {
- htmlErrorMsg $errStat2
- dbg "the following error happen: $errStat2" 3
- }
+ if { [info exist colval($v(UserName))] } {
+ set sql_str [concat UPDATE GradesTable SET \"$columnname\"=\'$colval($v(UserName))\' where UserName=\"$v(UserName)\"]
+ set err2 [catch {
+ db eval $sql_str
+ } errStat2 ]
+ if { $err2 } {
+ htmlErrorMsg $errStat2
+ dbg "the following error happen: $errStat2" 3
+ }
+ }
}
} errStat ]