Permalink
Browse files

Fix adding security groups to an existing instance

Commit 4c34f5f introduced a
regression making it impossible to add a security group to
an existing instance.

In the javascript membership module, make sure new members are still
assigned the default role even if the role dropdown is not displayed
(as is the case for the instance security group add/remove view).

Fixes bug 1158037.

Change-Id: I986f7296e97a08d5e9141fe0739d4e028e066fc1
(cherry picked from commit 64c0ddf)
  • Loading branch information...
1 parent f95dd00 commit 293e1c304700e6cf48f73bf2208083fbd68d9505 @conkiztador conkiztador committed with jpichon Mar 21, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 horizon/static/horizon/js/horizon.projects.js
@@ -351,13 +351,13 @@ horizon.projects = {
var user_el = $(this).parent().parent();
if (available) {
+ var default_role = horizon.projects.default_role_id;
$(this).text("-");
$(".project_members").append(user_el);
+ horizon.projects.add_user_to_role(user_id, default_role);
if (horizon.projects.has_roles) {
- var default_role = horizon.projects.default_role_id;
$(this).parent().siblings(".role_options").show();
- horizon.projects.add_user_to_role(user_id, default_role);
horizon.projects.update_user_role_dropdown(user_id, [default_role], user_el);
}
}

0 comments on commit 293e1c3

Please sign in to comment.