summaryrefslogtreecommitdiff
path: root/app/Controller/ProjectPermissionController.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-07-20 21:40:27 -0400
committerFrederic Guillot <fred@kanboard.net>2016-07-20 21:40:27 -0400
commit7b100cc57b58a1ef5c2c6cef28904e1ba79f0c49 (patch)
tree9cdd956135dc3083d522b77989c12e94664b7069 /app/Controller/ProjectPermissionController.php
parent3042504f9983e79e792e2df4e981ae310ab7ebeb (diff)
Move logic of PR #2496 to GroupModel
Diffstat (limited to 'app/Controller/ProjectPermissionController.php')
-rw-r--r--app/Controller/ProjectPermissionController.php8
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'])) {