Flashing an error if a nonexistent user is added to a project.

This commit is contained in:
Dj Padzensky 2016-04-08 15:20:34 -07:00
parent 4badb84dba
commit a941bfb2f9
1 changed files with 3 additions and 1 deletions

View File

@ -83,7 +83,9 @@ class ProjectPermission extends Base
$project = $this->getProject();
$values = $this->request->getValues();
if ($this->projectUserRole->addUser($values['project_id'], $values['user_id'], $values['role'])) {
if (empty($values['user_id'])) {
$this->flash->failure(t('User not found.'));
} elseif ($this->projectUserRole->addUser($values['project_id'], $values['user_id'], $values['role'])) {
$this->flash->success(t('Project updated successfully.'));
} else {
$this->flash->failure(t('Unable to update this project.'));