Committer: gprochaev
LJSUP-7871. Add function for manually forcing a community owner 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-09 07:37:20 UTC (rev 18242) +++ trunk/cgi-bin/LJ/Console/Command/CommunityPoll.pm 2011-02-09 08:37:26 UTC (rev 18243) @@ -35,12 +35,20 @@ my $confirm = undef; if ($maint_list eq 'confirm') { $confirm = 'confirm'; - my $m_list = LJ::load_rel_user($c->userid, 'A'); - $maint_list = join ',', map { $_->{user} } values %{LJ::load_userids(@$m_list)}; + $maint_list = undef; } else { $confirm = shift @args; } + ## If we not got maint_list + unless ($maint_list) { + my $m_list = LJ::load_rel_user($c->userid, 'A'); + $maint_list = join ',', map { $_->{user} } values %{LJ::load_userids(@$m_list)}; + } + + return $self->error("Community has not have maintainers") + unless $maint_list; + my @maintainers = split /,/, $maint_list; return $self->error("Election poll exists already")