Committer: gprochaev
LJSUP-7924. incorrect wokring command community_pollU trunk/cgi-bin/LJ/Console/Command/CommunityPoll.pm
Modified: trunk/cgi-bin/LJ/Console/Command/CommunityPoll.pm =================================================================== --- trunk/cgi-bin/LJ/Console/Command/CommunityPoll.pm 2011-02-10 10:45:42 UTC (rev 18264) +++ trunk/cgi-bin/LJ/Console/Command/CommunityPoll.pm 2011-02-10 10:47:03 UTC (rev 18265) @@ -48,20 +48,23 @@ return $self->error("Community has not have maintainers") unless $maint_list; - my @maintainers = split /,/, $maint_list; + my @got_maintainers = split /,/, $maint_list; return $self->error("Election poll exists already") if ($c->prop("election_poll_id") && $confirm ne 'confirm'); ## Check for maintainers alive - @maintainers = map { + my @maintainers = map { my $u = LJ::load_user($_); $u; } grep { my $u = LJ::load_user($_); $u && $u->is_visible && !$u->is_expunged && $u->can_manage($c) ? 1 : 0; - } @maintainers; + } @got_maintainers; + return $self->error("Can't create poll. At least one user is not maintainer of community $comm_name") + unless @maintainers == @got_maintainers; + return $self->error("Can't create poll. No maintainers given or they are not maintainers.") unless @maintainers;