Bug Fix - recurring task with no due date

- A recurring task may not be added without a due date.  Previously,
  this restriction only applied to modified tasks.
This commit is contained in:
Paul Beckingham 2009-08-04 16:26:23 -06:00
parent 0499bfff49
commit fc8f8957c4
2 changed files with 10 additions and 0 deletions

View file

@ -10,6 +10,7 @@
Federico Hernandez).
+ Fixed bug #242 that sometimes causes the ID echoed after a task is added
to be incorrect (thanks to John Florian).
+ Fixed bug that allowed a recurring task to be added without a due date.
------ old releases ------------------------------

View file

@ -84,6 +84,15 @@ std::string handleAdd ()
foreach (tag, context.tagAdditions)
context.task.addTag (*tag);
// Perform some logical consistency checks.
if (context.task.has ("recur") &&
!context.task.has ("due"))
throw std::string ("You cannot specify a recurring task without a due date.");
if (context.task.has ("until") &&
!context.task.has ("recur"))
throw std::string ("You cannot specify an until date for a non-recurring task.");
// Only valid tasks can be added.
context.task.validate ();