summaryrefslogtreecommitdiff
path: root/app/Controller/TaskCreationController.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-02-18 09:42:01 -0500
committerFrederic Guillot <fred@kanboard.net>2017-02-18 09:42:01 -0500
commitde128dbad860478496a0d655b5eb5c1005ebbabe (patch)
tree7fee510e901273472731e8e843981268c593ec40 /app/Controller/TaskCreationController.php
parent0430a09c069134622c0161dc2fb9ba3718a73c0d (diff)
Remove default swimlane
Diffstat (limited to 'app/Controller/TaskCreationController.php')
-rw-r--r--app/Controller/TaskCreationController.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/Controller/TaskCreationController.php b/app/Controller/TaskCreationController.php
index faf2d250..0d808c54 100644
--- a/app/Controller/TaskCreationController.php
+++ b/app/Controller/TaskCreationController.php
@@ -60,8 +60,14 @@ class TaskCreationController extends BaseController
$this->response->redirect($this->helper->url->to('BoardViewController', 'show', array('project_id' => $project['id'])), true);
} else {
$task_id = $this->taskCreationModel->create($values);
- $this->flash->success(t('Task created successfully.'));
- $this->afterSave($project, $values, $task_id);
+
+ if ($task_id > 0) {
+ $this->flash->success(t('Task created successfully.'));
+ $this->afterSave($project, $values, $task_id);
+ } else {
+ $this->flash->failure(t('Unable to create this task.'));
+ $this->response->redirect($this->helper->url->to('BoardViewController', 'show', array('project_id' => $project['id'])), true);
+ }
}
}