From 4c65fc369278013d054142b80f72929227f3ac8e Mon Sep 17 00:00:00 2001 From: Robin Malley Date: Mon, 12 Oct 2020 00:15:38 +0000 Subject: [PATCH] Allow logged in users to "hit" their own paste Increments the view counter in an edge case where the logged in user is viewing their own paste. --- src/lua/init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lua/init.lua b/src/lua/init.lua index 0dbd0fa..246105b 100644 --- a/src/lua/init.lua +++ b/src/lua/init.lua @@ -853,6 +853,11 @@ function read(req) --the page, since it'll have an edit button on it. assert(err == sql.ROW) local title, storytext, tauthor, isanon, authorname, views = unpack(stmnt_read:get_values()) + stmnt_update_views:bind_names{ + id = id + } + print("update:",do_sql(stmnt_update_views)) + stmnt_update_views:reset() storytext = zlib.decompress(storytext) stmnt_read:reset() if tauthor == authorid then