Opened 19 years ago
Closed 19 years ago
#4247 closed defect (fixed)
Ticket Model Component sets wrong 'exists' status
| Reported by: | Owned by: | Jonas Borgström | |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.11 |
| Component: | ticket system | Version: | 0.10.2 |
| Severity: | minor | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
I am trying to remove the default created components from the Ticket system using Ticket Model (through code), but the result is a Traceback: AssertionError: Cannot deleting non-existent component (typo here by the way :-)
Somehow trac.ticket.model.Component sets the wrong exists status - illustration from a new (default) Trac environment (it only seems to affect Component):
>>> from trac.env import Environment >>> myenv = Environment('/path/to/my/env') >>> from trac.ticket.model import Priority, Component, Milestone >>> for milestone in Milestone(myenv).select(myenv): print milestone.name, milestone.exists milestone1 True milestone2 True milestone3 True milestone4 True >>> for priority in Priority(myenv).select(myenv): print priority.name, priority.exists blocker True critical True major True minor True trivial True >>> for component in Component(myenv).select(myenv): print component.name, component.exists component1 False component2 False
Attachments (1)
Change History (5)
comment:1 by , 19 years ago
by , 19 years ago
| Attachment: | t4247.diff added |
|---|
Patch against trunk#4335 including unit test for this issue
comment:2 by , 19 years ago
Confirmed in trunk. Component and Version use custom classes, but most other classes under trac.ticket.model derive from AbstractEnum which was properly setting _old_name in select(). I've attached t4247.diff (and the # in the attachment description was supposed to be @)
comment:4 by , 19 years ago
| Milestone: | → 0.11 |
|---|---|
| Resolution: | → fixed |
| Severity: | normal → minor |
| Status: | new → closed |
Thanks! Patch applied in r4350.



Decided to test them all, and it also happens for Version:
Other property types tested OK.