Flashing an error if a nonexistent user is added to a project.
This commit is contained in:
parent
4badb84dba
commit
a941bfb2f9
|
|
@ -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.'));
|
||||
|
|
|
|||
Loading…
Reference in New Issue