Skip to content
Snippets Groups Projects
Commit c2930fe3 authored by Cecylia Bocovich's avatar Cecylia Bocovich
Browse files

Remove completed gettor requests from database

This will remove gettor requests from the requests database when they
are completed (rather than changing the status to 'SENT'). There's no
need to keep this information around, and we don't want to store
hashed email addresses as identifiers long term.
parent 3dfc2fdb
No related branches found
No related tags found
No related merge requests found
......@@ -191,9 +191,8 @@ class Sendmail(object):
service="email"
)
yield self.conn.update_request(
id=id, hid=hid.hexdigest(), status="SENT",
service="email", date=date
yield self.conn.remove_request(
id=id, service="email", date=date
)
except SMTPError as e:
......@@ -245,9 +244,8 @@ class Sendmail(object):
service="email"
)
yield self.conn.update_request(
id=id, hid=hid.hexdigest(), status="SENT",
service="email", date=date
yield self.conn.remove_request(
id=id, service="email", date=date
)
except SMTPError as e:
......
......@@ -72,15 +72,14 @@ class SQLite3(object):
query, (id, service)
).addCallback(self.query_callback).addErrback(self.query_errback)
def update_request(self, id, hid, status, service, date):
def remove_request(self, id, service, date):
"""
Update request record in the database
Removes completed request record from the database
"""
query = "UPDATE requests SET id=?, status=? WHERE id=? AND "\
"service=? AND date=?"
query = "DELETE FROM requests WHERE id=? AND service=? AND date=?"
return self.dbpool.runQuery(
query, (hid, status, id, service, date)
query, (id, service, date)
).addCallback(self.query_callback).addErrback(self.query_errback)
def update_stats(self, command, service, platform=None, language='en'):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment