Opened 10 years ago
Closed 10 years ago
#12140 closed enhancement (fixed)
Replace uses of ticket.values with Ticket item accessors
| Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.2 |
| Component: | ticket system | Version: | |
| Severity: | normal | Keywords: | refactoring |
| Cc: | Branch: | ||
| Release Notes: |
Refactored modules in |
||
| API Changes: |
The |
||
| Internal Changes: | |||
Description
The ticket class implements __getitem__ and __setitem__ to set and get from the values attribute, but many places in the code still work with the values attribute directly. For example, ticket.values['reporter'] has been used since [1831] but it appears it can be replaced with ticket['reporter'].
Directly setting to values could even be problematic due to the logic in __setitem__: tags/trac-1.1.6/trac/ticket/model.py#L186.
I considered trying to make values a protected attribute, but it is used to serialize the ticket properties:
Attachments (0)
Change History (3)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:3 by , 10 years ago
| API Changes: | modified (diff) |
|---|---|
| Release Notes: | modified (diff) |
| Resolution: | → fixed |
| Status: | assigned → closed |
Committed to trunk in [14213].



Proposed changes in log:rjollos.git:t12140_ticket_refactoring.