Mercurial > hg > egg-tcls
comparison tj.tcl @ 626:319c2e73860c
tj: When deleting a TJ, check if it exists and say so if it does not.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 11 Feb 2021 10:43:53 +0200 |
parents | 5eca657134a5 |
children | eaf766018133 |
comparison
equal
deleted
inserted
replaced
625:5eca657134a5 | 626:319c2e73860c |
---|---|
436 tj_msg $upublic $unick $uchan "err_sql" [list $uerrmsg] | 436 tj_msg $upublic $unick $uchan "err_sql" [list $uerrmsg] |
437 tj_log "$uerrmsg on SQL:\n$usql" | 437 tj_log "$uerrmsg on SQL:\n$usql" |
438 return 1 | 438 return 1 |
439 } | 439 } |
440 | 440 |
441 if {$nitems == 0} { | |
442 tj_msg $upublic $unick $uchan "err_no_such_id" [list $uid] | |
443 return 1 | |
444 } | |
445 | |
441 set usql "DELETE FROM tj WHERE uuser='[utl_escape $uhand]' AND uid LIKE '[utl_escape $uid]'" | 446 set usql "DELETE FROM tj WHERE uuser='[utl_escape $uhand]' AND uid LIKE '[utl_escape $uid]'" |
442 if {[catch {set ndone [tj_dbh onecolumn $usql]} uerrmsg]} { | 447 if {[catch {set ndone [tj_dbh onecolumn $usql]} uerrmsg]} { |
443 tj_msg $upublic $unick $uchan "err_sql" [list $uerrmsg] | 448 tj_msg $upublic $unick $uchan "err_sql" [list $uerrmsg] |
444 tj_log "$uerrmsg on SQL:\n$usql" | 449 tj_log "$uerrmsg on SQL:\n$usql" |
445 return 1 | 450 return 1 |