GTG

Problem with remove_tag() method - AttributeError: 'NoneType' object has no attribute 'get_children'

Bug #1095451 reported by Tom Kadwill
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GTG
Won't Fix
Undecided
Unassigned

Bug Description

Whist implementing a delete tag feature (for bug #1044639) I encountered a problem with the remove_tag() method. The issue does not cause a problem with GTG in terms of functionality but shows an error when running from the debug script.

To reproduce the error use the remove_tag() method to remove a tag (or hit the delete key if my solution for bug #1044639 has been merged). Then open a task a hit backspace, you should then see an error and associated stack trace in the terminal. I have pasted mine below as an example:

Traceback (most recent call last):
  File "/home/tom/bazaar/gtg/delete-tag2/GTG/gtk/editor/taskview.py", line 586, in modified
    self.save_task()
  File "/home/tom/bazaar/gtg/delete-tag2/GTG/gtk/editor/editor.py", line 513, in light_save
    self.save()
  File "/home/tom/bazaar/gtg/delete-tag2/GTG/gtk/editor/editor.py", line 497, in save
    self.task.sync()
  File "/home/tom/bazaar/gtg/delete-tag2/GTG/core/task.py", line 612, in sync
    self.modified()
  File "/usr/lib/python2.7/dist-packages/liblarch/treenode.py", line 51, in modified
    self.tree.modify_node(self.node_id, priority=priority)
  File "/usr/lib/python2.7/dist-packages/liblarch/tree.py", line 88, in modify_node
    self._queue.push(self._modify_node, node_id, priority=priority)
  File "/usr/lib/python2.7/dist-packages/liblarch/processqueue.py", line 65, in push
    func(*element[1:])
  File "/usr/lib/python2.7/dist-packages/liblarch/tree.py", line 269, in _modify_node
    self._callback('node-modified', node_id)
  File "/usr/lib/python2.7/dist-packages/liblarch/tree.py", line 78, in _callback
    func(node_id)
  File "/usr/lib/python2.7/dist-packages/liblarch/viewcount.py", line 85, in __modify
    displayed &= filt.is_displayed(nid)
  File "/usr/lib/python2.7/dist-packages/liblarch/filters_bank.py", line 42, in is_displayed
    value = self.func(task, parameters=self.dic)
  File "/home/tom/bazaar/gtg/delete-tag2/GTG/core/treefactory.py", line 146, in tag_filter
    return node.has_tags([tag])
  File "/home/tom/bazaar/gtg/delete-tag2/GTG/core/task.py", line 767, in has_tags
    toreturn = children_tag(tagname)
  File "/home/tom/bazaar/gtg/delete-tag2/GTG/core/task.py", line 751, in children_tag
    for tagc_name in tag.get_children():
AttributeError: 'NoneType' object has no attribute 'get_children'

Jeff Fortin Tam (kiddo)
Changed in gtg:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.