7 | | It looks like we need to refactoring `Query.template_data`. |
| 7 | The following change fixes the failure: |
| 8 | {{{#!diff |
| 9 | diff --git a/trac/ticket/query.py b/trac/ticket/query.py |
| 10 | index aba697389..b82fd2ca7 100644 |
| 11 | --- a/trac/ticket/query.py |
| 12 | +++ b/trac/ticket/query.py |
| 13 | @@ -769,6 +769,7 @@ class Query(object): |
| 14 | field['options'].insert(0, {'name': '$USER', |
| 15 | 'value': '$USER'}) |
| 16 | if name == 'milestone' and not field.get('custom'): |
| 17 | + field = field.copy() |
| 18 | milestones = [Milestone(self.env, opt) |
| 19 | for opt in field['options']] |
| 20 | milestones = [m for m in milestones |
| 21 | }}} |
| 22 | |
| 23 | However, it looks like we need to refactoring `Query.template_data`. Isn't the `Query` class more like a model? It seems like it shouldn't be involved in preparing data for the view, rather that should be the responsibility of `QueryModule`. |