]> git.agnieray.net Git - galette.git/commitdiff
Ensure group is created before setting its managers
authorJohan Cwiklinski <johan@x-tnd.be>
Mon, 12 Oct 2020 17:13:35 +0000 (19:13 +0200)
committerJohan Cwiklinski <johan@x-tnd.be>
Mon, 12 Oct 2020 17:13:54 +0000 (19:13 +0200)
galette/lib/Galette/Controllers/Crud/GroupsController.php

index 0bfb524c091f4042b0e8eafdfa19c54a53557543..9c033c99c6ceebdc648de69ae0e4f46716107b26 100644 (file)
@@ -90,10 +90,10 @@ class GroupsController extends CrudController
         $group = new Group();
         $group->setLogin($this->login);
         $group->setName($args['name']);
+        $group->store();
         if (!$this->login->isSuperAdmin()) {
             $group->setManagers(new Adherent($this->zdb, $this->login->id));
         }
-        $group->store();
         $id = $group->getId();
 
         return $response