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_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.