Opened 11 years ago
Last modified 11 years ago
#11026 closed defect
Traceback when succ and pred are not configured — at Initial Version
Reported by: | Ryan J Ollos | Owned by: | Chris Nelson |
---|---|---|---|
Priority: | normal | Component: | TracJsGanttPlugin |
Severity: | normal | Keywords: | |
Cc: | pete | Trac Release: |
Description
I just installed the plugin in a dev environment and haven't specified any configuration yet. On line 2508 of tracpm.py
, entries in linkfieldname
are set to None
if the field hasn't been configured, but then there is no check as to whether the dictionary entry is None
before trying to use it.
-
tracjsganttplugin/0.11/tracjsgantt/tracpm.py
diff --git a/tracjsganttplugin/0.11/tracjsgantt/tracpm.py b/tracjsganttplugin/0. index 4d4b4e2..86eb6fb 100644
a b class TicketRescheduler(Component): 2505 2505 # FIXME - this is a really gross and fragile way to do it but 2506 2506 # it'll due for now. 2507 2507 linkFieldNames = {} 2508 for linkField in [ 2508 for linkField in ['parent', 'pred', 'succ']: 2509 2509 if not self.pm.isCfg(linkField): 2510 2510 linkFieldNames[linkField] = None 2511 2511 elif self.pm.isField(linkField): … … class TicketRescheduler(Component): 2527 2527 2528 2528 # Predecessors and successors 2529 2529 for linkField in ['pred', 'succ']: 2530 t[linkFieldNames[linkField]] = \ 2531 [tid for tid in t[linkFieldNames[linkField]] 2530 if linkFieldNames[linkField]: 2531 t[linkFieldNames[linkField]] = \ 2532 [tid for tid in t[linkFieldNames[linkField]] 2532 2533 if tid in ticketsByID] 2533 2534 2534 2535 return tickets
Note: See
TracTickets for help on using
tickets.