Edgewall Software

Ticket #3495 (closed defect: fixed)

Opened 2 years ago

Last modified 2 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:

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

follow-up: ↓ 2   Changed 2 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?

in reply to: ↑ 1   Changed 2 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

  Changed 2 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.

  Changed 2 years ago by cboos

  • status changed from assigned to closed
  • resolution set to fixed

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.

Add/Change #3495 (Ticket Delete Bug)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.