Opened 15 years ago
Closed 15 years ago
#8817 closed defect (fixed)
Milestone insert() method is not updating _old_name member
Reported by: | Owned by: | Remy Blank | |
---|---|---|---|
Priority: | normal | Milestone: | 0.11.6 |
Component: | general | Version: | none |
Severity: | normal | Keywords: | milestone, update, insert |
Cc: | support@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
The current Milestone insert() method is not updating the _old_name member, therefore it is not possible to create and update a milestone without closing it and reopening it. I understand that is not vital to trac, as apparently the creation and the updates are done in different requests, but is an error in the model integrity.
The patch is deadly simple:
Index: trac/ticket/model.py =================================================================== --- trac/ticket/model.py (revision 8744) +++ trac/ticket/model.py (working copy) @@ -693,7 +693,8 @@ "VALUES (%s,%s,%s,%s)", (self.name, to_timestamp(self.due), to_timestamp(self.completed), self.description)) - + self._old_name = self.name + if handle_ta: db.commit() TicketSystem(self.env).reset_ticket_fields()
Attachments (0)
Change History (2)
comment:1 by , 15 years ago
Milestone: | → 0.11.6 |
---|---|
Owner: | set to |
comment:2 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Actually, not only milestones, but also components and versions exhibited the same issue. I have added test cases for this use case and fixed the issue in [8811].
Thanks for the bug report and the solution!
I'll do that later tonight.