summaryrefslogtreecommitdiff
path: root/app/models/member.rb
diff options
context:
space:
mode:
authorJames Lopez <james.lopez@vodafone.com>2015-10-29 16:10:27 +0000
committerJames Lopez <james.lopez@vodafone.com>2015-10-29 16:10:27 +0000
commitde990aa15829d0ab182ad5a55b4c527846c0d39c (patch)
tree8a4feb62b5f4b6f03d5fe03a0ff3ee9e99815f17 /app/models/member.rb
parent0ea38dc519b86d2bd2e14f1df1baf0fffc043af6 (diff)
downloadgitlab-ce-de990aa15829d0ab182ad5a55b4c527846c0d39c.tar.gz
fixed last group owner issue and added test
Diffstat (limited to 'app/models/member.rb')
-rw-r--r--app/models/member.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/models/member.rb b/app/models/member.rb
index cae8caa23fb..bc7e70178e1 100644
--- a/app/models/member.rb
+++ b/app/models/member.rb
@@ -81,11 +81,12 @@ class Member < ActiveRecord::Base
member = members.build
member.invite_email = user
end
+ if !current_user || current_user.can?(:update_group_member, member)
+ member.created_by ||= current_user
+ member.access_level = access_level
- member.created_by ||= current_user
- member.access_level = access_level
-
- member.save
+ member.save
+ end
end
end