Enhancement
- More consistent test of when adding or deleting a dependency. - Update one unit test.
This commit is contained in:
committed by
Paul Beckingham
parent
20ae5fed81
commit
5ffb65b5ac
@@ -801,6 +801,11 @@ void Task::addDependency (const std::string& uuid)
|
||||
if (uuid == get ("uuid"))
|
||||
throw std::string (STRING_TASK_DEPEND_ITSELF);
|
||||
|
||||
// Check that uuid is resolvable.
|
||||
int id = context.tdb2.pending.id (uuid);
|
||||
if (id == 0)
|
||||
throw format (STRING_TASK_DEPEND_MISS_CREA, id);
|
||||
|
||||
// Store the dependency.
|
||||
std::string depends = get ("depends");
|
||||
if (depends != "")
|
||||
@@ -837,6 +842,8 @@ void Task::removeDependency (const std::string& uuid)
|
||||
set ("depends", combined);
|
||||
recalc_urgency = true;
|
||||
}
|
||||
else
|
||||
throw format (STRING_TASK_DEPEND_MISS_DEL, uuid);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user