Commit 1bec32a8a5e694e41679e5a9075758720888728f
1 parent
d8cedf7d
Exists in
staging
and in
42 other branches
Fixing pre-population on add members
Showing
2 changed files
with
2 additions
and
3 deletions
Show diff stats
app/controllers/my_profile/profile_members_controller.rb
app/views/profile_members/_manage_roles.html.erb
... | ... | @@ -13,11 +13,11 @@ |
13 | 13 | |
14 | 14 | <% @roles.each do |role| %> |
15 | 15 | <% search_url = url_for(:action => 'search_user', :profile => profile.identifier, :role => role.id) %> |
16 | - <% @pre_population ||= profile.members_by_role_to_json(role) %> | |
16 | + <% pre_population = params[:action] == 'last_admin' ? [].to_json : profile.members_by_role_to_json(role) %> | |
17 | 17 | <script type="text/javascript"> |
18 | 18 | jQuery(<%= ('#search_' + role.key).to_json %>) |
19 | 19 | .tokenInput("<%= search_url %>", { |
20 | - prePopulate: <%= @pre_population %>, | |
20 | + prePopulate: <%= pre_population %>, | |
21 | 21 | hintText: <%= _('Type in a search term for users').to_json %>, |
22 | 22 | noResultsText: <%= _('No results').to_json %>, |
23 | 23 | searchingText: <%= _('Searching...').to_json %>, | ... | ... |