diff --git a/CHANGELOG b/CHANGELOG index 05d1e7bdb40014dfc3dd38172738fd35d1dd173d..3ddb7876b72d8ee5841f757235e22e023d26b620 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -58,6 +58,7 @@ v 7.8.0 (unreleased) - Add quick help links to the GitLab pricing and feature comparison pages. - Fix duplicate authorized applications in user profile and incorrect application client count in admin area. - Make sure Markdown previews always use the same styling as the eventual destination. + - Remove deprecated Group#owner_id from API v 7.7.2 - Update GitLab Shell to version 2.4.2 that fixes a bug when developers can push to protected branch diff --git a/doc/api/groups.md b/doc/api/groups.md index 3c1858e697d90be7c7662425b55f08359c0d9904..b5a4b05ccaf2cd0cdd9487d8f2d6be698e6d84c8 100644 --- a/doc/api/groups.md +++ b/doc/api/groups.md @@ -14,7 +14,6 @@ GET /groups "id": 1, "name": "Foobar Group", "path": "foo-bar", - "owner_id": 18, "description": "An interesting group" } ] @@ -87,7 +86,6 @@ GET /groups?search=foobar "id": 1, "name": "Foobar Group", "path": "foo-bar", - "owner_id": 18, "description": "An interesting group" } ] diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 8d0664386b402f49910ff50817bde9eefd43ea76..7572104fc16855cd549b94f9c9665020cffaf3ec 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -65,7 +65,7 @@ module API end class Group < Grape::Entity - expose :id, :name, :path, :owner_id, :description + expose :id, :name, :path, :description end class GroupDetail < Group diff --git a/lib/api/groups.rb b/lib/api/groups.rb index 384a28e41f5735e0ebce37fc047832c33f37f6c9..a92abd4b6907fe529d6689bcc88662feab81bb63 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -33,9 +33,9 @@ module API attrs = attributes_for_keys [:name, :path, :description] @group = Group.new(attrs) - @group.owner = current_user if @group.save + @group.add_owner(current_user) present @group, with: Entities::Group else render_api_error!("Failed to save group #{@group.errors.messages}", 400)