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

huzaifafaruqui wants to merge 5 commits from /u/huzaifafaruqui/allura/ to master, 2017-04-25

Commit Date  
[358bd0] (master) by huzaifafaruqui huzaifafaruqui

[#8059] Excluded options from deleted tickets in search's dropdown filter

2017-04-06 17:22:58 Tree
[5b84e3] by huzaifafaruqui huzaifafaruqui

[#8059] Excluded options from deleted tickets in search's dropdown filter

2017-03-31 16:28:23 Tree
[3b1801] by huzaifafaruqui huzaifafaruqui

[#8059] Excluded options from deleted tickets in search's dropdown filter

2017-03-21 11:30:59 Tree
[26d348] by huzaifafaruqui huzaifafaruqui

Merge remote-tracking branch 'upstream/master'

2017-03-16 17:38:12 Tree
[7c6143] by huzaifafaruqui huzaifafaruqui

[#8059] Excluded options from deleted tickets in search's dropdown filter

2017-03-15 18:18:25 Tree

Discussion

  • Dave Brondsema

    Dave Brondsema - 2017-03-16

    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.

     
  • Dave Brondsema

    Dave Brondsema - 2017-03-24

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

     
  • huzaifafaruqui - 2017-03-31

    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 & add

     elif deleted and not has_access(c.app, 'delete'):
                deleted = False
    

    just after the has_access checks in both the RootController class and MilestoneController class, it will fix the bug mentioned

     
    • Dave Brondsema

      Dave Brondsema - 2017-03-31

      Ah, yep you are right about q.

      Can you push a commit with the change you describe? Then I can test it.

       
  • Dave Brondsema

    Dave Brondsema - 2017-04-03

    Getting close! This works for the index page and milestone pages. The search pages need a similar update

     
  • Dave Brondsema

    Dave Brondsema - 2017-04-25
    • Status: open --> merged
     
  • Dave Brondsema

    Dave Brondsema - 2017-04-25

    I didn't notice the last update to this, sorry for the delay. I have merged it now.

     

Log in to post a comment.