Mercurial > hg > egg-tcls
changeset 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 | f0b998b1716d |
files | tj.tcl |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tj.tcl Thu Feb 11 10:32:51 2021 +0200 +++ b/tj.tcl Thu Feb 11 10:43:53 2021 +0200 @@ -438,6 +438,11 @@ return 1 } + if {$nitems == 0} { + tj_msg $upublic $unick $uchan "err_no_such_id" [list $uid] + return 1 + } + set usql "DELETE FROM tj WHERE uuser='[utl_escape $uhand]' AND uid LIKE '[utl_escape $uid]'" if {[catch {set ndone [tj_dbh onecolumn $usql]} uerrmsg]} { tj_msg $upublic $unick $uchan "err_sql" [list $uerrmsg]