diff options
Diffstat (limited to 'app/Controller')
-rw-r--r-- | app/Controller/ProjectPermissionController.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/Controller/ProjectPermissionController.php b/app/Controller/ProjectPermissionController.php index 3fb6c090..1301285f 100644 --- a/app/Controller/ProjectPermissionController.php +++ b/app/Controller/ProjectPermissionController.php @@ -135,10 +135,14 @@ class ProjectPermissionController extends BaseController $values['group_id'] = $this->groupModel->getOrCreateExternalGroupId($values['name'], $values['external_id']); } - if ($this->projectGroupRoleModel->addGroup($project['id'], $values['group_id'], $values['role'])) { - $this->flash->success(t('Project updated successfully.')); + if (empty($values['group_id'])) { + $this->flash->failure(t('Unable to find this group.')); } else { - $this->flash->failure(t('Unable to update this project.')); + if ($this->projectGroupRoleModel->addGroup($project['id'], $values['group_id'], $values['role'])) { + $this->flash->success(t('Project updated successfully.')); + } else { + $this->flash->failure(t('Unable to update this project.')); + } } $this->response->redirect($this->helper->url->to('ProjectPermissionController', 'index', array('project_id' => $project['id']))); |