Modify ↓
Opened 14 years ago
Last modified 14 years ago
#9838 assigned defect
NameError: global name 'fieldname' is not defined
| Reported by: | Owned by: | Chris Nelson | |
|---|---|---|---|
| Priority: | normal | Component: | TracJsGanttPlugin |
| Severity: | normal | Keywords: | |
| Cc: | Trac Release: | 0.12 |
Description
I'm using childticketplugin also. Is the parent field empty JSGantt works. Is parent field filled with a number for example #XXXX than it fails with error below.
Traceback (most recent call last):
File "C:\Programme\Python25\lib\site-packages\trac-0.12.2-py2.5.egg\trac\wiki\formatter.py", line 717, in _macro_formatter
return macro.process(args, in_paragraph=True)
File "C:\Programme\Python25\lib\site-packages\trac-0.12.2-py2.5.egg\trac\wiki\formatter.py", line 304, in process
text = self.processor(text)
File "C:\Programme\Python25\lib\site-packages\trac-0.12.2-py2.5.egg\trac\wiki\formatter.py", line 291, in _macro_processor
text)
File "build\bdist.win32\egg\tracjsgantt\tracjsgantt.py", line 621, in expand_macro
tasks = self._add_tasks(options)
File "build\bdist.win32\egg\tracjsgantt\tracjsgantt.py", line 559, in _add_tasks
self.pm.postQuery(options, self.tickets)
File "build\bdist.win32\egg\tracjsgantt\tracpm.py", line 643, in postQuery
t[fieldname] = parent[1:]
NameError: global name 'fieldname' is not defined
I checked this part of coding where the error comes up but I can't find any error. Do you have any idea?
def postQuery(self, options, tickets): # Handle custom fields. # Clean up custom fields which might be null ('--') vs. blank ('') ... # Normalize parent field values. All parent values must be # done before building child lists, below. if self.isCfg('parent'): for t in tickets: # ChildTicketsPlugin puts '#' at the start of the # parent field. Strip it for simplicity. fieldName = self.fields[self.sources['parent']] parent = t[fieldName] if len(parent) > 0 and parent[0] == '#': t[fieldname] = parent[1:]
didley
Attachments (0)
Change History (5)
comment:1 Changed 14 years ago by
comment:3 Changed 14 years ago by
| Status: | new → assigned |
|---|
Note: See
TracTickets for help on using
tickets.



note case of "n" on last line
t[fieldName](right) vs.t[fieldname](presumably wrong)