Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

#3495 closed defect (fixed)

Ticket Delete Bug

Reported by: coderanger@… Owned by: Christian Boos
Priority: normal Milestone: 0.10
Component: ticket system Version: devel
Severity: major Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal 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 (0)

Change History (4)

comment:1 by Emmanuel Blot, 18 years ago

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 comment:2 by Matthew Good, 18 years ago

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 by Christian Boos, 18 years ago

Owner: changed from Jonas Borgström to Christian Boos
Status: newassigned

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

comment:4 by Christian Boos, 18 years ago

Resolution: fixed
Status: assignedclosed

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.