Changeset 116
- Timestamp:
- 10/05/06 14:10:20 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
emailtotracscript/trunk/delete_spam.py.in
r111 r116 83 83 84 84 cursor = db.cursor() 85 tkt_cursor = db.cursor() 85 86 86 87 # Delete the attachments associated with Spam tickets … … 93 94 spam_id = row[0] 94 95 96 if debug: 97 sql_cmd = "SELECT * FROM attachment WHERE type='ticket' and id='%s';" %spam_id 98 tkt_cursor.execute(sql_cmd) 99 row = tkt_cursor.fetchone() 100 print row 101 102 sql_cmd = "SELECT * FROM ticket_change WHERE ticket='%s';" %spam_id 103 tkt_cursor.execute(sql_cmd) 104 row = tkt_cursor.fetchone() 105 print row 106 107 sql_cmd = "SELECT * FROM ticket_custom WHERE ticket='%s';" %spam_id 108 tkt_cursor.execute(sql_cmd) 109 row = tkt_cursor.fetchone() 110 print row 111 95 112 sql_cmd = "DELETE FROM attachment WHERE type='ticket' and id='%s';" %spam_id 96 cursor.execute(sql_cmd)113 tkt_cursor.execute(sql_cmd) 97 114 98 115 sql_cmd = "DELETE FROM ticket_change WHERE ticket='%s';" %spam_id 99 cursor.execute(sql_cmd)116 tkt_cursor.execute(sql_cmd) 100 117 101 118 sql_cmd = "DELETE FROM ticket_custom WHERE ticket='%s';" %spam_id 102 cursor.execute(sql_cmd) 119 tkt_cursor.execute(sql_cmd) 120 121 # Ticket commit 122 # 123 db.commit() 103 124 104 125 dir = os.path.join(attachment_dir, str(spam_id))
Note: See TracChangeset
for help on using the changeset viewer.