Modify ↓
Opened 9 years ago
Closed 9 years ago
#12589 closed defect (fixed)
overall_completion=as_bool(group.get('overall_completion'))) fails due to NoneType
Reported by: | Owned by: | Rob Guttman | |
---|---|---|---|
Priority: | normal | Component: | SumStatsPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.12 |
Description
General behaviour
After installation and configuration, while trying to see the new roadmap, the following error is displayed and no roadmap is shown:
"AttributeError: 'NoneType' object has no attribute 'lower'"
Steps to reproduce
- Trac 0.12 with a minimal set of other plugins.
- Installed the plugin as documented in the plugin page.
- The component was then enabled in trac.ini.
- Replaced DefaultTicketGroupStatsProvider with this plugin's new SumTicketGroupStatsProvider in trac.ini in the [roadmap] section.
- Added a custom text field called estimatedeffort in trac.ini
- Added the following section to trac.ini
[sumstats] field = estimatedeffort label = estimatedeffort
- Restarted the web server
- Tried to open the 'Roadmap' page in the trac environment.
- The error "AttributeError: 'NoneType' object has no attribute 'lower'" is reported and no roadmap is shown.
- As a check if nothing else was misconfigured, the gorup stats provider was reset to 'DefaultTicketGroupStatsProvider', and the original roadmap was shown again.
Bug details
In 'get_ticket_group_stats' while running:
overall_completion=as_bool(group.get('overall_completion')))
group.get('overall_completion') evaluates to 'NoneType', making as_bool() fail.
Callback:
Most recent call last: File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 513, in _dispatch_request File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 235, in dispatch File "build/bdist.linux-x86_64/egg/trac/ticket/roadmap.py", line 350, in process_request File "build/bdist.linux-x86_64/egg/trac/ticket/roadmap.py", line 257, in get_ticket_stats File "build/bdist.linux-x86_64/egg/sumstats/web_ui.py", line 163, in get_ticket_group_stats
Local variable contents:
group {'status': u'assigned,new,accepted,reopened', 'css_class': 'open', ... self <sumstats.web_ui.SumTicketGroupStatsProvider object at 0x7f93c6a935d0> stat <trac.ticket.roadmap.TicketGroupStats object at 0x7f93c6889290> ticket_ids [1, 31, 22, 24, 37, 52, 53, 106, 15, 28, 30, 34, 35, 36, 38, 44, 45, 57, ...
Attachments (0)
Change History (3)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
I'll push the untested fix. Please comment if you continue to have issues after updating to the latest.
Note: See
TracTickets for help on using
tickets.
as_bool
in Trac 0.12 was less robust than it is now:In 0.12:
Therefore we should probably make the change: