Commit e0f9f503 authored by Ted Trask's avatar Ted Trask

Cleaned up clearselected even though not used

parent 1de5a09a
......@@ -1205,10 +1205,10 @@ function editselected(data)
databaseconnect(DatabaseOwner)
con:execute("START TRANSACTION")
for i,sel in ipairs(data.value.select.value) do
con:execute("UPDATE pubweblog SET selected = true WHERE id = '"..escape(sel).."'")
assert (con:execute("UPDATE pubweblog SET selected = true WHERE id = '"..escape(sel).."'"))
end
for i,sel in ipairs(data.value.deselect.value) do
con:execute("UPDATE pubweblog SET selected = false WHERE id = '"..escape(sel).."'")
assert (con:execute("UPDATE pubweblog SET selected = false WHERE id = '"..escape(sel).."'"))
end
con:execute("COMMIT")
databasedisconnect()
......@@ -1220,13 +1220,17 @@ function editselected(data)
end
function clearselected()
local retval = cfe({ label="Clear selected records", errtxt = "Failed to clear selected records - who knows why" })
sql = "UPDATE pubweblog SET selected = false WHERE selected = true"
databaseconnect(DatabaseOwner)
assert (con:execute(sql))
databasedisconnect()
retval.value = "Cleared"
retval.errtxt = nil
local retval = cfe({ label="Clear selected records" })
local res, err = pcall(function()
sql = "UPDATE pubweblog SET selected = false WHERE selected = true"
databaseconnect(DatabaseOwner)
assert (con:execute(sql))
databasedisconnect()
retval.value = "Cleared"
end)
if not res then
retval.errtxt = err
end
return retval
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment