summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-07-20 20:43:17 -0400
committerFrederic Guillot <fred@kanboard.net>2016-07-20 20:43:17 -0400
commit3042504f9983e79e792e2df4e981ae310ab7ebeb (patch)
tree7a5e445cafac1002336edfed3b9c08f16714ba20
parent390082aa41cb81610089163b1cc3a256f3b3c513 (diff)
parent57f66cc855458d9fd76c9a3073de2852a6e0712f (diff)
Merge pull-request #2496
-rw-r--r--app/Controller/ProjectPermissionController.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/Controller/ProjectPermissionController.php b/app/Controller/ProjectPermissionController.php
index f3ca6ed9..cbcdf77d 100644
--- a/app/Controller/ProjectPermissionController.php
+++ b/app/Controller/ProjectPermissionController.php
@@ -147,7 +147,13 @@ class ProjectPermissionController extends BaseController
$values = $this->request->getValues();
if (empty($values['group_id']) && ! empty($values['external_id'])) {
- $values['group_id'] = $this->groupModel->create($values['name'], $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']);
+ }
}
if ($this->projectGroupRoleModel->addGroup($project['id'], $values['group_id'], $values['role'])) {