Bug Fix - #360 Huh? "You cannot remove the recurrence from a recurring task. "

- The logic for detecting changes to a recurring task was wrong.
- Added unit tests for this bug.
This commit is contained in:
Paul Beckingham 2010-01-24 17:35:37 -05:00
parent 545013e839
commit 383962173e
3 changed files with 78 additions and 5 deletions

View file

@ -1133,13 +1133,14 @@ int handleModify (std::string &outs)
!task->has ("recur"))
throw std::string ("You cannot specify an until date for a non-recurring task.");
if (task->has ("due") &&
!context.task.has ("due") &&
context.task.has ("recur"))
if (task->has ("due") &&
context.task.has ("due") &&
context.task.get ("due") == "")
throw std::string ("You cannot remove the due date from a recurring task.");
if (task->has ("recur") &&
!context.task.has ("recur"))
if (task->has ("recur") &&
context.task.has ("recur") &&
context.task.get ("recur") == "")
throw std::string ("You cannot remove the recurrence from a recurring task.");
// Make all changes.