diff options
author | mkanat%bugzilla.org <> | 2009-09-30 08:59:50 +0000 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2009-09-30 08:59:50 +0000 |
commit | aadb30fd9cb9401d9f1ed9e82dbc02899851d11d (patch) | |
tree | 1db4297f2d4848cd03c704a6aa93a5813c8e3311 | |
parent | 2594ac1a4d32fe6ec0c2e67887857f6d634cbc0c (diff) | |
download | bugs-aadb30fd9cb9401d9f1ed9e82dbc02899851d11d.tar bugs-aadb30fd9cb9401d9f1ed9e82dbc02899851d11d.tar.gz bugs-aadb30fd9cb9401d9f1ed9e82dbc02899851d11d.tar.bz2 bugs-aadb30fd9cb9401d9f1ed9e82dbc02899851d11d.tar.xz bugs-aadb30fd9cb9401d9f1ed9e82dbc02899851d11d.zip |
Bug 511796: Allow groups to bless themselves
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
-rwxr-xr-x | editgroups.cgi | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/editgroups.cgi b/editgroups.cgi index 0554638fa..e8d8cfe24 100755 --- a/editgroups.cgi +++ b/editgroups.cgi @@ -113,16 +113,19 @@ sub get_current_and_available { if !grep($_->id == $group_option->id, @visible_to_me_current); } - # The group itself should never show up in the bless or - # membership lists. + push(@bless_from_available, $group_option) + if !grep($_->id == $group_option->id, @bless_from_current); + + # The group itself should never show up in the membership lists, + # and should show up in only one of the bless lists (otherwise + # you can try to allow it to bless itself twice, leading to a + # database unique constraint error). next if $group_option->id == $group->id; push(@members_available, $group_option) if !grep($_->id == $group_option->id, @members_current); push(@member_of_available, $group_option) if !grep($_->id == $group_option->id, @member_of_current); - push(@bless_from_available, $group_option) - if !grep($_->id == $group_option->id, @bless_from_current); push(@bless_to_available, $group_option) if !grep($_->id == $group_option->id, @bless_to_current); } |