mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Related to bug #649
- You can no longer directly complete or delete parent recurring tasks.
This commit is contained in:
parent
6608cbf287
commit
f93273ef23
2 changed files with 77 additions and 64 deletions
|
@ -1572,6 +1572,9 @@ int handleDelete (std::string& outs)
|
|||
sprintf (endTime, "%u", (unsigned int) time (NULL));
|
||||
|
||||
foreach (task, tasks)
|
||||
{
|
||||
if (task->getStatus () == Task::pending ||
|
||||
task->getStatus () == Task::waiting)
|
||||
{
|
||||
if (context.hooks.trigger ("pre-delete", *task))
|
||||
{
|
||||
|
@ -1670,6 +1673,16 @@ int handleDelete (std::string& outs)
|
|||
context.hooks.trigger ("post-delete", *task);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
out << "Task "
|
||||
<< task->id
|
||||
<< " '"
|
||||
<< task->get ("description")
|
||||
<< "' is neither pending nor waiting.\n";
|
||||
rc = 1;
|
||||
}
|
||||
}
|
||||
|
||||
context.tdb.commit ();
|
||||
context.tdb.unlock ();
|
||||
|
|
|
@ -47,7 +47,7 @@ qx{../src/task rc:bug.rc add Test due:3d rec:1w};
|
|||
|
||||
# Result: Immediately delete the created task
|
||||
my $output = qx{../src/task rc:bug.rc done 1};
|
||||
like ($output, qr/Completed/ms, 'New recurring task can be immediately deleted.');
|
||||
unlike ($output, qr/Completed/ms, 'New recurring task cannot be immediately completed.');
|
||||
|
||||
# Cleanup.
|
||||
unlink 'pending.data';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue