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:
@@ -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 ------------------------------
|
||||
|
||||
|
||||
@@ -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 ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user