Although adding dependencies should be done using LazyUUIDTaskSet.add, I previously made an attempt through directly assigning a LazyUUIDTaskSet (produced by deserialize_depends or direct instantiation) which produced the following Traceback:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 1, in <listcomp>
File "/home/huntrar/.local/lib/python3.5/site-packages/tasklib/task.py", line 144, in _modified_fields
if new_value != old_value:
File "/home/huntrar/.local/lib/python3.5/site-packages/tasklib/lazy.py", line 112, in __ne__
return not (self == other)
File "/home/huntrar/.local/lib/python3.5/site-packages/tasklib/lazy.py", line 109, in __eq__
return set(t['uuid'] for t in other) == self._uuids
TypeError: 'NoneType' object is not iterable
The issue is in the equality operator in LazyUUIDTaskSet. When you are comparing the new and old data when checking for modified fields, the equality operator is assuming the compared object is an iterable when in fact the dict.get() method is returning None on account of having no preeexisting dependencies.
Note this issue only exists when modifying the depends field of a previously saved task. If you are creating the task for the first time and perform this assignment and then save, there are no issues.
Although adding dependencies should be done using LazyUUIDTaskSet.add, I previously made an attempt through directly assigning a LazyUUIDTaskSet (produced by deserialize_depends or direct instantiation) which produced the following Traceback:
The issue is in the equality operator in LazyUUIDTaskSet. When you are comparing the new and old data when checking for modified fields, the equality operator is assuming the compared object is an iterable when in fact the dict.get() method is returning None on account of having no preeexisting dependencies.
Note this issue only exists when modifying the depends field of a previously saved task. If you are creating the task for the first time and perform this assignment and then save, there are no issues.