From c54258e6a4ba9a7e56e4a81730b762ecbe97ed8c Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Thu, 15 Jan 2015 21:55:20 +0100 Subject: [PATCH 1/1] Task: Do not yield corner case of fake removals as modified field --- tasklib/task.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 2.39.5