Git
Merge Request #187: Updated search query in ticket search to not show options from deleted tickets in filters (merged)
Merging...
Merged
Something went wrong. Please, merge manually
Checking if merge is possible...
Something went wrong. Please, merge manually
Original repository by
huzaifafaruqui
is deleted
Discussion
Log in to post a comment.
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_searchand that needsfilter_choicesto 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 updateqto 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_deletedisn't just True or False. If you look at the places that callpaged_query_or_searchand passshow_deletedthrough, they do ahas_accesscheck. That check needs to apply to theshow_deletedparameter too (called justdeletedthere).If I modified
qthen 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_accesschecks in both theRootControllerclass andMilestoneControllerclass, 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.