Commit 07b42749f2cc58afb2c12edc4c191a8cfac0dc5f
Committed by
Joenio Costa
1 parent
6845e153
Exists in
master
and in
23 other branches
Enterprise adds member through the id instead of the identifier
(ActionItem1583)
Showing
3 changed files
with
4 additions
and
4 deletions
Show diff stats
app/controllers/my_profile/profile_members_controller.rb
| ... | ... | @@ -69,7 +69,7 @@ class ProfileMembersController < MyProfileController |
| 69 | 69 | |
| 70 | 70 | def add_member |
| 71 | 71 | if profile.enterprise? |
| 72 | - member = Person.find_by_identifier(params[:id]) | |
| 72 | + member = Person.find(params[:id]) | |
| 73 | 73 | member.define_roles(Profile::Roles.all_roles(environment), profile) |
| 74 | 74 | end |
| 75 | 75 | render :layout => false | ... | ... |
app/views/profile_members/find_users.rhtml
| ... | ... | @@ -17,7 +17,7 @@ |
| 17 | 17 | <%= button_to_remote_without_text(:add, _('Add member'), |
| 18 | 18 | { :loading => '$("members-list").addClassName("loading")', |
| 19 | 19 | :update => 'members-list', |
| 20 | - :url => {:action => 'add_member', :profile => profile.identifier, :id => user.identifier}, | |
| 20 | + :url => {:action => 'add_member', :profile => profile.identifier, :id => user.id}, | |
| 21 | 21 | :success => "$('tr-#{user.identifier}').hide()", |
| 22 | 22 | :complete => '$("members-list").removeClassName("loading")'}) %> |
| 23 | 23 | ... | ... |
test/functional/profile_members_controller_test.rb
| ... | ... | @@ -203,7 +203,7 @@ class ProfileMembersControllerTest < Test::Unit::TestCase |
| 203 | 203 | login_as :test_user |
| 204 | 204 | |
| 205 | 205 | u = create_user('member_wannabe').person |
| 206 | - post :add_member, :profile => ent.identifier, :id => u.identifier | |
| 206 | + post :add_member, :profile => ent.identifier, :id => u.id | |
| 207 | 207 | ent.reload |
| 208 | 208 | |
| 209 | 209 | assert_includes ent.members, p |
| ... | ... | @@ -216,7 +216,7 @@ class ProfileMembersControllerTest < Test::Unit::TestCase |
| 216 | 216 | login_as :test_user |
| 217 | 217 | |
| 218 | 218 | u = create_user('member_wannabe').person |
| 219 | - post :add_member, :profile => ent.identifier, :id => u.identifier | |
| 219 | + post :add_member, :profile => ent.identifier, :id => u.id | |
| 220 | 220 | |
| 221 | 221 | assert_equivalent Profile::Roles.all_roles(ent.environment).compact, u.role_assignments.find_all_by_resource_id(ent.id).map(&:role).compact |
| 222 | 222 | end | ... | ... |