diff options
Diffstat (limited to 'app/Controller')
-rw-r--r-- | app/Controller/ProjectPermissionController.php | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/app/Controller/ProjectPermissionController.php b/app/Controller/ProjectPermissionController.php index cbcdf77d..99f556e8 100644 --- a/app/Controller/ProjectPermissionController.php +++ b/app/Controller/ProjectPermissionController.php @@ -147,13 +147,7 @@ class ProjectPermissionController extends BaseController $values = $this->request->getValues(); if (empty($values['group_id']) && ! empty($values['external_id'])) { - $group = $this->groupModel->getByExternalId($values['external_id']); - if ($group) { - $values['group_id'] = $group['id']; - } - else { - $values['group_id'] = $this->groupModel->create($values['name'], $values['external_id']); - } + $values['group_id'] = $this->groupModel->getOrCreateExternalGroupId($values['name'], $values['external_id']); } if ($this->projectGroupRoleModel->addGroup($project['id'], $values['group_id'], $values['role'])) { |