Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#7996 closed defect (fixed)

csv export doesn't work

Reported by: anonymous Owned by: rjollos
Priority: normal Component: TracHoursPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description (last modified by rjollos)

When trying to export tickets using the CSV function, it returns:

AttributeError: 'list' object has no attribute 'keys'

How to Reproduce

While doing a GET operation on /hours, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{'format': u'csv'}

User agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20100722 Firefox/3.6.8

System Information

System information not available

Enabled Plugins

Plugin information not available

Python Traceback

Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/trac/web/", line 511, in _dispatch_request
  File "build/bdist.linux-x86_64/egg/trac/web/", line 237, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.5/site-packages/TracHoursPlugin-0.5.2-py2.5.egg/trachours/", line 234, in process_request
    return self.process_timeline(req)
  File "/usr/lib/python2.5/site-packages/TracHoursPlugin-0.5.2-py2.5.egg/trachours/", line 509, in process_timeline
    return self.display_html(req, query)
  File "/usr/lib/python2.5/site-packages/TracHoursPlugin-0.5.2-py2.5.egg/trachours/", line 834, in display_html
    self.queryhours2csv(req, data)
  File "/usr/lib/python2.5/site-packages/TracHoursPlugin-0.5.2-py2.5.egg/trachours/", line 986, in queryhours2csv
    for constraint in sorted(data['constraints'].keys()):
AttributeError: 'list' object has no attribute 'keys'

Attachments (0)

Change History (5)

comment:1 Changed 4 years ago by rjollos

  • Description modified (diff)
  • Owner changed from ejucovy to rjollos
  • Status changed from new to assigned

Confirmed with Trac 0.12.2dev-r10331.

comment:2 Changed 4 years ago by rjollos

See #6336 for a related issue with another plugin. In particular, the link in that thread to the Google Groups message is helpful.

comment:3 Changed 4 years ago by rjollos

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [9618]) Fixed CSV export of data on the hours page by accounting for a change in the Trac API. In Trac 0.12, constraints is a list of dictionaries. Previously, it was just a dictionary. Fixes #7996.

The add filter function on the Hours page required a similar change. Refs #7642.

comment:4 Changed 4 years ago by rjollos

(In [9619]) Removed some print statement that should have been removed before committing [9618]. Refs #7996.

comment:5 Changed 4 years ago by rjollos

(In [9620]) Merged [9617:9619] from trunk to branches/0.12. Refs #7996.

Add Comment

Modify Ticket

as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from rjollos. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.

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

Note: See TracTickets for help on using tickets.