Edgewall Software

Ticket #4554 (closed enhancement: duplicate)

Opened 2 years ago

Last modified 20 months ago

Add configuration for default filters (constraints) for ticket queries

Reported by: lance_rushing@… Owned by: jonas
Priority: normal Milestone:
Component: ticket system Version: 0.9.6
Severity: trivial Keywords: query
Cc:

Description

Our ticket system doesn't need the owner filter applied by default.

I added a boolean config setting to remove the owner filter from the default filters.

Patch for version 0.9.6

  • query.py

    old new  
    360360            # with no parameters. Instead show only open tickets, possibly 
    361361            # associated with the user 
    362362            constraints = {'status': ('new', 'assigned', 'reopened')} 
    363             if req.authname and req.authname != 'anonymous': 
    364                 constraints['owner'] = (req.authname,) 
    365             else: 
    366                 email = req.session.get('email') 
    367                 name = req.session.get('name') 
    368                 if email or name: 
    369                     constraints['cc'] = ('~%s' % email or name,) 
     363            if self.config.getbool('query', 'default_filter_owner'): 
     364                if req.authname and req.authname != 'anonymous': 
     365                   constraints['owner'] = (req.authname,) 
     366                else: 
     367                    email = req.session.get('email') 
     368                    name = req.session.get('name') 
     369                    if email or name: 
     370                        constraints['cc'] = ('~%s' % email or name,) 
    370371 
    371372        query = Query(self.env, constraints, req.args.get('order'), 
    372373                      req.args.has_key('desc'), req.args.get('group'), 

And trac.ini additions:

[query]
default_filter_owner = false

I don't know if it might be better to create a default_filter array of some sort, but the boolean works for my current needs.

Attachments

Change History

Changed 21 months ago by cboos

  • keywords query added
  • severity changed from normal to trivial
  • milestone set to 0.11

Should be default_user_filter instead, as it's only filtering on owner if the user is logged in, but filters on cc otherwise.

Changed 20 months ago by cboos

  • status changed from new to closed
  • resolution set to duplicate
  • milestone 0.11 deleted

Superseded by #2409.

Add/Change #4554 (Add configuration for default filters (constraints) for ticket queries)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from jonas. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.