Unbreak commitfest_topic_warning code.
authorRobert Haas <robertmhaas@gmail.com>
Mon, 27 Sep 2010 16:28:09 +0000 (12:28 -0400)
committerRobert Haas <robertmhaas@gmail.com>
Mon, 27 Sep 2010 16:28:09 +0000 (12:28 -0400)
perl-lib/PgCommitFest/Patch.pm

index f8c311a974aaaacbba4a72a28e54fd88bbdc8060..dd3ef699fd2d1ea5dfd00360f2d4d63d3814fc1c 100644 (file)
@@ -105,6 +105,7 @@ EOM
        my $commitfest_topic = $r->db->select(<<EOM, $d->{'commitfest_id'});
 SELECT id, name FROM commitfest_topic WHERE commitfest_id = ? ORDER BY name
 EOM
+       my $commitfest_topic_warning = ! @$commitfest_topic;
        unshift @$commitfest_topic, { 'id' => '', 'name' => '(None Selected)' };
        $r->control('commitfest_topic')->choice($commitfest_topic);
        $r->add_control('patch_status', 'select', 'Patch Status', 'required' => 1);
@@ -163,7 +164,7 @@ EOM
 
        # Display template.
        $r->render_template('patch_form', { 'id' => $id, 'd' => $d,
-               'commitfest_topic_warning' => !@$commitfest_topic,
+               'commitfest_topic_warning' => $commitfest_topic_warning,
                'new_commitfest' => $cf });
 }