X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/68aa8a1759d350a4e6fcd79ab6b2e0e61e7bd538..58f3ecf4ed9351d3226b3ac0152ec56313f79431:/tasklib/task.py diff --git a/tasklib/task.py b/tasklib/task.py index 1ab6347..f61fb05 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -245,7 +245,15 @@ class Task(TaskResource): def _modified_fields(self): writable_fields = set(self._data.keys()) - set(self.read_only_fields) for key in writable_fields: - if self._data.get(key) != self._original_data.get(key): + new_value = self._data.get(key) + old_value = self._original_data.get(key) + + # Make sure not to mark data removal as modified field if the + # field originally had some empty value + if key in self._data and not new_value and not old_value: + continue + + if new_value != old_value: yield key @property