mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-25 03:07:20 +02:00
Check if end date is being set to a pending task (#3622)
check if end date is being set to a pending task -throw error if end date is being set to a pending task - add test for the bug
This commit is contained in:
parent
c00c0e941b
commit
d75ef7f197
2 changed files with 19 additions and 0 deletions
|
@ -116,6 +116,11 @@ void CmdModify::checkConsistency(Task &before, Task &after) {
|
|||
|
||||
if (before.has("recur") && (!after.has("recur") || after.get("recur") == ""))
|
||||
throw std::string("You cannot remove the recurrence from a recurring task.");
|
||||
|
||||
if ((before.getStatus() == Task::pending) && (after.getStatus() == Task::pending) &&
|
||||
(after.get("end") != ""))
|
||||
throw format("Could not modify task {1}. You cannot set an end date on a pending task.",
|
||||
before.identifier(true));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue