#8716 closed enhancement (fixed)
Ticket Options like default_milestone should be in the TicketSystem not the TicketModule
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | low | Milestone: | 0.12 |
Component: | ticket system | Version: | 0.12dev |
Severity: | minor | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
These don't have anything to do with the request or the web page. Also you can see that you need these options in the TicketSystem so that the information where/how the settings are stored in the configuration is currently duplicated.
Attachments (2)
Change History (13)
by , 15 years ago
Attachment: | 8716_move_ticket_options_to_ticketsystem added |
---|
follow-up: 2 comment:1 by , 15 years ago
follow-up: 3 comment:2 by , 15 years ago
Replying to cboos:
I'm fine with the move of options from TicketModule to TicketSystem.
Won't this unnecessarily break plugins that expect those options in TicketModule
? Shouldn't we at least have "forwarders" in TicketModule
and deprecate their use?
follow-up: 4 comment:3 by , 15 years ago
Replying to rblank:
Won't this unnecessarily break plugins that expect those options in
TicketModule
? Shouldn't we at least have "forwarders" inTicketModule
and deprecate their use?
So the idea would be to add properties which forward to the TicketSystem + DeprecationWarning?
comment:4 by , 15 years ago
Replying to Felix Schwarz <felix.schwarz@…>:
So the idea would be to add properties which forward to the TicketSystem + DeprecationWarning?
I'd say yes for the properties, but DeprecationWarning
s are ugly. I would just add a big fat comment above the properties warning that they will be removed in 0.13.
by , 15 years ago
Attachment: | 8716_move_ticket_options_to_ticketsystem.patch added |
---|
Move default_...
field value Options from TicketModule to TicketSystem. (patch on trunk, r8787)
comment:5 by , 15 years ago
Owner: | set to |
---|
New patch 8716_move_ticket_options_to_ticketsystem.patch added, please review.
comment:6 by , 15 years ago
Looks good, one minor nitpick: I would use a single _warnings
attribute with a set()
of the option names where the warning has been shown, instead of using separate _warn_*
attributes and getattr()
magic.
follow-up: 9 comment:7 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch applied, with the above suggestion taken into account, in [8792].
Thank you Felix for the initial patch.
comment:8 by , 15 years ago
follow-up: 10 comment:9 by , 15 years ago
comment:10 by , 15 years ago
comment:11 by , 10 years ago
The deprecated accessor in the TicketModule
was removed in [12962] (comment:18:ticket:11494).
I'm fine with the move of options from TicketModule to TicketSystem.
However, I think both the config API and the access through descriptors have their use, one should pick whichever makes for the most readable code.
So for example:
trac/ticket/default_workflow.py
self.config.get('ticket', 'default_resolution'))is fine, but:
trac/ticket/model.py
makes it actually harder to read, I think.