Modify

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#13181 closed defect (fixed)

AttributeError: 'dict' object has no attribute 'getlist' when calling hours

Reported by: anonymous Owned by: EmeCas
Priority: normal Component: TracHoursPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description

Hello!

when i try to call hours/ i get the following error. Calling hours/xy works as expected.

 Trac detected an internal error:

AttributeError: 'dict' object has no attribute 'getlist'

Stacktrace:

Python Traceback
Most recent call last:

File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 562, in _dispatch_request
  dispatcher.dispatch(req)
File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 249, in dispatch
  resp = chosen_handler.process_request(req)
File "build/bdist.linux-x86_64/egg/trachours/hours.py", line 224, in process_request
  return self.process_timeline(req)
File "build/bdist.linux-x86_64/egg/trachours/hours.py", line 491, in process_timeline
  return self.display_html(req, query)
File "build/bdist.linux-x86_64/egg/trachours/hours.py", line 827, in display_html
  add_link(req, 'prev', self.get_href(query, prev_args, context.href),
File "build/bdist.linux-x86_64/egg/trachours/hours.py", line 534, in get_href
  cols = args.getlist('col')

Code (hours.py):

 532     def get_href(self, query, args, *a, **kw):
 533         base = query.get_href(*a, **kw)
 534         cols = args.getlist('col')

System:

Trac 	1.0.12
Docutils 	0.12
Genshi 	0.7 (with speedups)
psycopg2 	2.6
Pygments 	2.1.3
Python 	2.7.12 (default, Jun 28 2016, 06:57:42) [GCC]
pytz 	2015.2
RPC 	1.1.7.dev0
setuptools 	18.0.1
Textile 	2.3.10
jQuery	1.7.2
jQuery UI	1.8.21
jQuery Timepicker	1.0.1

Attachments (0)

Change History (4)

comment:1 Changed 7 years ago by EmeCas

What version of TracHoursPlugin are you running?

comment:2 Changed 7 years ago by Ryan J Ollos

I caused the issue in r16474. Probably just need to revert the change:

  • trachours/hours.py

     
    527527
    528528    def get_href(self, query, args, *a, **kw):
    529529        base = query.get_href(*a, **kw)
    530         cols = args.getlist('col')
    531530        if cols:
     531            if isinstance(cols, basestring):
     532                cols = [cols]
    532533            base += '&' + "&".join("col=%s" % col
    533534                                   for col in cols if col not in query.cols)

comment:3 Changed 7 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

In 16608:

TracHours 0.6.0dev: Fix AttributeError due to incorrect use of getlist

Fixes #13181.

comment:4 Changed 7 years ago by Ryan J Ollos

In 16609:

TracHours 0.6.0dev: Add missing change from r16608

Refs #13181.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain EmeCas.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.