wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r18263: LJSUP-7871

Committer: gprochaev
LJSUP-7871
U   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:43:30 UTC (rev 18262)
+++ trunk/cgi-bin/LJ/Console/Command/CommunityPoll.pm	2011-02-10 10:44:51 UTC (rev 18263)
@@ -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;
 

Tags: livejournal, pm, wisest-owl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments