This works well for the index listing of tickets, and the milestone page's list. However if you do a search, the search results use a different code path: paged_search and that needs filter_choices to be updated there too.
IIRC, the search page queries solr, and index & milestone pages query mongo, which is why they work differently.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A little cleanup: there's no need to use q_ you can just update q to a new value.
The kw.get('show_deleted',False) check needs to be updated a little bit. Its good to include that check, but if I'm not logged in then I don't have permission to view anything about deleted tickets. However, if I test that by copying a URL that includes deleted tickets, and paste it in an incognito window, then I still can see the values in the dropdown filter. I think this is because the show_deleted isn't just True or False. If you look at the places that call paged_query_or_search and pass show_deleted through, they do a has_access check. That check needs to apply to the show_deleted parameter too (called just deleted there).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This works well for the index listing of tickets, and the milestone page's list. However if you do a search, the search results use a different code path:
paged_search
and that needsfilter_choices
to be updated there too.IIRC, the search page queries solr, and index & milestone pages query mongo, which is why they work differently.
A little cleanup: there's no need to use
q_
you can just updateq
to a new value.The
kw.get('show_deleted',False)
check needs to be updated a little bit. Its good to include that check, but if I'm not logged in then I don't have permission to view anything about deleted tickets. However, if I test that by copying a URL that includes deleted tickets, and paste it in an incognito window, then I still can see the values in the dropdown filter. I think this is because theshow_deleted
isn't just True or False. If you look at the places that callpaged_query_or_search
and passshow_deleted
through, they do ahas_access
check. That check needs to apply to theshow_deleted
parameter too (called justdeleted
there).If I modified
q
then the modified query will appear in search results in the search field so I made a copy.If I modify
tracker_main.py
& addjust after the
has_access
checks in both theRootController
class andMilestoneController
class, it will fix the bug mentionedAh, yep you are right about
q
.Can you push a commit with the change you describe? Then I can test it.
Getting close! This works for the index page and milestone pages. The search pages need a similar update
I didn't notice the last update to this, sorry for the delay. I have merged it now.