Merge "do not allow story id to change via payload"

This commit is contained in:
Zuul 2018-02-11 15:14:30 +00:00 committed by Gerrit Code Review
commit 8c3808ac7a
1 changed files with 6 additions and 0 deletions

View File

@ -664,6 +664,12 @@ class TasksNestedController(rest.RestController):
if original_task.story_id != story_id:
abort(400, _("URL story_id and task.story_id do not match"))
if task.story_id and original_task.story_id != task.story_id:
abort(
400,
_("the story_id of a task cannot be changed through this API"),
)
task = task_is_valid_put(task, original_task)
updated_task = tasks_api.task_update(task_id, task.as_dict(