Opened 15 years ago
Closed 11 years ago
#6540 closed enhancement (wontfix)
[Patch] Configuration for tickets "not" of given types
Reported by: | Adam Bellaire | Owned by: | Vladimir Abramov |
---|---|---|---|
Priority: | low | Component: | TypedTicketWorkflowPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
This plugin works great, but the fact that your configuration is opt-in can make certain configurations a hassle. Luckily, it was pretty trivial to patch the code to allow for an additional configuration for nottickettype
, which is the opposite of tickettype
configuration option.
For example, if you have "someaction" that isn't applicable to tasks, you can say:
someaction.nottickettype = task
Since this is an additional configuration option on top of the existing setup, enabling the patched version of the plugin for existing configurations won't break anything, and having "nottickettype" in your configuration if you don't have the patch will simply be ignored.
Here's the patch against r7501:
-
controller.py
25 25 filterd_actions.append((default, action_name)) 26 26 else: 27 27 filterd_actions.append((default, action_name)) 28 return filterd_actions 29 No newline at end of file 28 if 'nottickettype' in action_attributes: 29 # note that if both tickettype and nottickettype are specified for the same 30 # type, nottickettype will have precendence and the action will be unavailable 31 forbidden_types = [a.strip() for a in 32 action_attributes['nottickettype'].split(',')] 33 if (ticket.get_value_or_default('type') in forbidden_types and 34 (default, action_name) in filterd_actions): 35 filterd_actions.remove((default, action_name)) 36 return filterd_actions
Attachments (0)
Change History (2)
comment:1 Changed 15 years ago by
Summary: | Configuration for tickets "not" of given types → [Patch] Configuration for tickets "not" of given types |
---|---|
Type: | defect → enhancement |
comment:2 Changed 11 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Most users will have a fairly small number of ticket types, and I think that another configuration option will just confuse things for the most part.