From 3178e0cbf03805c19f4b6bd7bd58627acef5e2ee Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" Date: Wed, 30 Sep 2009 08:59:50 +0000 Subject: [PATCH] Bug 511796: Allow groups to bless themselves Patch by Max Kanat-Alexander r=LpSolit, a=LpSolit git-svn-id: svn://10.0.0.236/trunk@258533 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/editgroups.cgi | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mozilla/webtools/bugzilla/editgroups.cgi b/mozilla/webtools/bugzilla/editgroups.cgi index 0554638faf9..e8d8cfe24e6 100755 --- a/mozilla/webtools/bugzilla/editgroups.cgi +++ b/mozilla/webtools/bugzilla/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); }