Skip to content

Commit

Permalink
TracTicketGraph 1.0.6: Make default daysback configurable
Browse files Browse the repository at this point in the history
Fixes #11.
  • Loading branch information
rjollos committed Jul 26, 2017
1 parent 9276ce7 commit c564546
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name='TracTicketGraph',
version='1.0.5',
version='1.0.6',
packages=['ticketgraph'],
package_data={'ticketgraph': ['htdocs/*.*', 'templates/*.*']},

Expand Down
7 changes: 6 additions & 1 deletion ticketgraph/ticketgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import math
import pkg_resources

from trac.config import IntOption
from trac.core import Component, implements
from trac.perm import IPermissionRequestor
from trac.ticket import model
Expand Down Expand Up @@ -58,6 +59,10 @@ class TicketGraphModule(Component):
implements(INavigationContributor, IPermissionRequestor, IRequestHandler,
ITemplateProvider)

default_daysback = IntOption(
'ticketgraph', 'default_daysback', 90,
"""Default number of days display in the graph.""")

# IPermissionRequestor methods

def get_permission_actions(self):
Expand Down Expand Up @@ -90,7 +95,7 @@ def match_request(self, req):
def process_request(self, req):
req.perm.require('TICKET_GRAPH')

days_back = req.args.getint('days', 90)
days_back = req.args.getint('days', self.default_daysback)
component = req.args.get('component', '')

today = datetime.datetime.now(utc)
Expand Down

0 comments on commit c564546

Please sign in to comment.