Edgewall Software

Changes between Initial Version and Version 7 of Ticket #12349


Ignore:
Timestamp:
Apr 9, 2016, 1:17:08 AM (5 years ago)
Author:
Ryan J Ollos
Comment:

I'm going to fix a few instances, such as comment:5.

  • trac/timeline/web_ui.py

    diff --git a/trac/timeline/web_ui.py b/trac/timeline/web_ui.py
    index 050f142..15f8c79 100644
    a b class TimelineModule(Component):  
    9090    def process_request(self, req):
    9191        req.perm.assert_permission('TIMELINE_VIEW')
    9292
    93         format = req.args.get('format')
    94         maxrows = as_int(req.args.get('max'), 50 if format == 'rss' else 0)
     93        format = req.args.getfirst('format')
     94        default_maxrows = 50 if format == 'rss' else 0
     95        maxrows = as_int(req.args.getfirst('max'), default_maxrows)
    9596        lastvisit = int(req.session.get('timeline.lastvisit', '0'))
    9697
    9798        # indication of new events is unchanged when form is updated by user
    class TimelineModule(Component):  
    109110        precisedate = precision = None
    110111        if 'from' in req.args:
    111112            # Acquire from date only from non-blank input
    112             reqfromdate = req.args['from'].strip()
     113            reqfromdate = req.args.getfirst('from').strip()
    113114            if reqfromdate:
    114115                try:
    115116                    precisedate = user_time(req, parse_date, reqfromdate)
    class TimelineModule(Component):  
    117118                    add_warning(req, e)
    118119                else:
    119120                    fromdate = precisedate.astimezone(req.tz)
    120             precision = req.args.get('precision', '')
     121            precision = req.args.getfirst('precision', '')
    121122            if precision.startswith('second'):
    122123                precision = timedelta(seconds=1)
    123124            elif precision.startswith('minute'):
    class TimelineModule(Component):  
    130131                                        fromdate.day, 23, 59, 59, 999999),
    131132                               req.tz)
    132133
    133         daysback = as_int(req.args.get('daysback'),
     134        daysback = as_int(req.args.getfirst('daysback'),
    134135                          90 if format == 'rss' else None)
    135136        if daysback is None:
    136137            daysback = as_int(req.session.get('timeline.daysback'), None)
    class TimelineModule(Component):  
    140141        if self.max_daysback >= 0:
    141142            daysback = min(self.max_daysback, daysback)
    142143
    143         authors = req.args.get('authors')
     144        authors = req.args.getfirst('authors')
    144145        if authors is None and format != 'rss':
    145146            authors = req.session.get('timeline.authors')
    146147        authors = (authors or '').strip()

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12349

    • Property Status newassigned
    • Property Owner set to Ryan J Ollos
    • Property Milestone 1.0.101.0.11
  • Ticket #12349 – Release Notes

    initial v7  
     1Replaced uses of `args.get` with `args.getfirst` in request processing code for the timeline page, to reduce noise in the log files due to invalid requests.