Edgewall Software
Modify

Ticket #3495 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

Ticket Delete Bug

Reported by: coderanger@… Owned by: cboos
Priority: normal Milestone: 0.10
Component: ticket system Version: devel
Severity: major Keywords:
Cc:
Release Notes:
API Changes:

Description

From the looks of the code, when deleting a ticket it will delete the attachment metadata in the db, but not the actual files. Over time these could build up and cause problems.

Attachments

Change History

comment:1 follow-up: Changed 6 years ago by eblot

Not sure to understand this point:

The delete code looks like this:

        if os.path.isfile(self.path):
            try:
                os.unlink(self.path)
            except OSError:
                ...

so the file is actually deleted, isn't it?

comment:2 in reply to: ↑ 1 Changed 6 years ago by mgood

Replying to eblot:

Not sure to understand this point:

The delete code looks like this:
…snip…
so the file is actually deleted, isn't it?

Yes, but that code is not called when deleting a ticket. The Ticket.delete() method deletes the rows directly from the database without removing the files:
trunk/trac/ticket/model.py@3544#L308

comment:3 Changed 6 years ago by cboos

  • Owner changed from jonas to cboos
  • Status changed from new to assigned

Right, we should use Attachment.delete() for deleting the attachments.

comment:4 Changed 6 years ago by cboos

  • Resolution set to fixed
  • Status changed from assigned to closed

Done in r3595.

The only remaining "issue" is that the empty attachment ticket folder is left behind. If you think it would be cleaner to remove that too, just let me know.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from cboos. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.