aboutsummaryrefslogtreecommitdiffstats
path: root/src/acit/types.py
diff options
context:
space:
mode:
authorVosjedev <vosje@vosjedev.net>2025-11-17 18:23:23 +0100
committerVosjedev <vosje@vosjedev.net>2025-11-17 18:23:23 +0100
commit307569a3e64a2ae6ce9f97309dcb26a54c3f2e73 (patch)
treef5a3103d2f407d2e0f111b2256255155af09dcbc /src/acit/types.py
parent520038f61516e6e10835c7f70511d2f21898cfe0 (diff)
downloadacit-307569a3e64a2ae6ce9f97309dcb26a54c3f2e73.tar.gz
acit-307569a3e64a2ae6ce9f97309dcb26a54c3f2e73.tar.bz2
acit-307569a3e64a2ae6ce9f97309dcb26a54c3f2e73.tar.xz
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
Diffstat (limited to 'src/acit/types.py')
-rw-r--r--src/acit/types.py29
1 files changed, 20 insertions, 9 deletions
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()