From 307569a3e64a2ae6ce9f97309dcb26a54c3f2e73 Mon Sep 17 00:00:00 2001 From: Vosjedev Date: Mon, 17 Nov 2025 18:23:23 +0100 Subject: Email commands, plus 'a _bit_ more' - you can now edit bugs via email - fixed acit not resending mailinglist email correctly - make sure you don't make a new bug when receiving the first email of a bug in your inbox and replying to it - make forwarding email only delete loopback email when save argument is false - don't add empty Cc or Bcc headers to prevent errors when sending without them - make the thing that formats the In-Reply-To and References header a separate function - only update projectpages when reloading projectlist, not bugpages - fix tracker subscribers not working --- src/acit/types.py | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'src/acit/types.py') diff --git a/src/acit/types.py b/src/acit/types.py index fd9d20a..3d41297 100644 --- a/src/acit/types.py +++ b/src/acit/types.py @@ -47,11 +47,21 @@ class Site(): ")" ) - #cur.execute( - # "CREATE TABLE IF NOT EXISTS accounts (" - # "email VARCHAR(80)," - # "hash VARCHAR(80)," - # )# TODO + cur.execute( + "CREATE TABLE IF NOT EXISTS permissiontable (" + "email VARCHAR(80)," + "tracker VARCHAR(80)," + "bugid INT)" + ) + + cur.execute( + "CREATE TABLE IF NOT EXISTS tokens (" + "email VARCHAR(80)," + "token VARCHAR(80)," + "tracker VARCHAR(80)," + "bugid INT," + "usedin TINYTEXT DEFAULT NULL)" + ) conn.commit() @@ -104,12 +114,13 @@ class Site(): name,homepage=data - log(name) + #log(name) cur.execute("REPLACE INTO trackers (name,homepage) VALUES (?,?)",(name,homepage)) conn.commit() - self.update_all_bugpages(conn,cur,trackerfilter=name) + #self.update_all_bugpages(conn,cur,trackerfilter=name) + cherrypy.engine.publish("regen",name,None) self.last_tracker_update=datetime.now() @@ -346,7 +357,7 @@ class Tracker(): NOTE: this executes an SQL query. """ with self.site.dbpool.get_connection() as conn, conn.cursor() as cur: - cur.execute("SELECT email FROM subscribers WHERE tracker=? AND bugid=NULL",(self.tracker,)) + cur.execute("SELECT email FROM subscribers WHERE tracker=? AND bugid IS NULL",(self.tracker,)) return [ value[0] for value in cur ] def addsubscriber(self,email): @@ -356,6 +367,6 @@ class Tracker(): def rmsubscriber(self,email): with self.site.dbpool.get_connection() as conn, conn.cursor() as cur: - cur.execute("DELETE FROM subscribers WHERE tracker=? AND bugid=NULL AND email=?)",(self.tracker,email)) + cur.execute("DELETE FROM subscribers WHERE tracker=? AND bugid IS NULL AND email=?)",(self.tracker,email)) conn.commit() -- cgit