Trac is located at http://trac.uwcs.co.uk/.

Spam

Wiki spam can be deleted by anyone with appropriate priviledges. At time of writing, for both Choob and Website, this includes Faux and Silver.

Deleting tickets is slightly more fun, as it can't be done via. trac itself.

   1 from pysqlite2 import dbapi2 as sqlite
   2 import sys
   3 trac_env = "db/trac.db"
   4 
   5 try:
   6  id = sys.argv[1]
   7 except:
   8  print "Usage: remove_ticket.py id"
   9  sys.exit()
  10 
  11 con = sqlite.connect(trac_env)
  12 cur = con.cursor()
  13 cur.execute("DELETE FROM ticket WHERE id=%s" % (id,))
  14 cur.execute("DELETE FROM ticket_change WHERE ticket=%s" % (id,))
  15 cur.execute("DELETE FROM attachment WHERE type='ticket' and id=%s" % (id,))
  16 cur.execute("DELETE FROM ticket_custom WHERE ticket=%s" % (id,))
  17 
  18 con.commit()
  19 print "Ticket #%s deleted" % id

There is a link to this script in each of the projects' directories, use something like:

svn@bermuda:/var/lib/trac/website$ python remove_ticket.py 52
Ticket #52 deleted

Note the lack of checking, and that it works on the live database without backup.

You have been warned.

Techteam Wiki: Services/Trac (last edited 2009-02-17 15:52:29 by localhost)