Unverified Commit f6b4261e authored by IKEDA Soji's avatar IKEDA Soji Committed by GitHub
Browse files

Merge pull request #504 from ikedas/unused_info_in_home by ikedas

WWSympa: Loading home page takes long time
parents 9f7e4d8a 934c9636
......@@ -314,7 +314,6 @@ nobase_default_DATA = \
web_tt2/modindex.tt2 \
web_tt2/my.tt2 \
web_tt2/nav.tt2 \
web_tt2/news.tt2 \
web_tt2/notice.tt2 \
web_tt2/picture_upload.tt2 \
web_tt2/pref.tt2 \
......
......@@ -9946,77 +9946,6 @@ sub do_create_list_request {
sub do_home {
wwslog('info', '');
 
unless ($session->is_anonymous()) {
my @which_owner =
Sympa::List::get_which($param->{'user'}{'email'}, $robot,
'owner');
my @which_editor = Sympa::List::get_which($param->{'user'}{'email'},
$robot, 'editor');
my @which_member = Sympa::List::get_which($param->{'user'}{'email'},
$robot, 'member');
## Build the admin_summary variable that tells foreach list
## how many messages/subscriptions are awaiting moderation
foreach my $one_list (@which_owner, @which_editor) {
# skip already treated ones
next
if $param->{'admin_summary'}{$one_list->{'name'}};
my $mod_message =
Sympa::Spool::Moderation->new(context => $one_list)->size;
$param->{'admin_summary'}{$one_list->{'name'}}{'mod_message'} =
$mod_message
if $mod_message;
my $mod_subscription = Sympa::Spool::Auth->new(
context => $one_list,
action => 'add'
)->size;
$param->{'admin_summary'}{$one_list->{'name'}}{'mod_subscription'}
= $mod_subscription
if $mod_subscription;
my $mod_signoff = Sympa::Spool::Auth->new(
context => $one_list,
action => 'del'
)->size;
$param->{'admin_summary'}{$one_list->{'name'}}{'mod_signoff'} =
$mod_signoff
if $mod_signoff;
my $shared_doc = Sympa::WWW::SharedDocument->new($one_list);
my $mod_shared_total = $shared_doc->count_moderated_descendants;
$param->{'admin_summary'}{$one_list->{'name'}}{'mod_shared_total'}
= $mod_shared_total
if $mod_shared_total;
}
## Build the errors_summary variable, tells for a suscriber
## how many sending messages are in errors
foreach my $the_list (@which_member) {
# review all the lists
next if $param->{'errors_summary'}{$the_list->{'name'}};
my $user = $the_list->get_list_member($param->{'user'}{'email'});
$the_list->parse_list_member_bounce($user);
# if there is bounces put it in errors_summary
if ($user->{bounce_count}) {
$param->{'errors_summary'}{$the_list->{'name'}} = {
count => $user->{bounce_count},
first => $language->gettext_strftime(
"%d %b %Y", localtime($user->{first_bounce})
),
last => $language->gettext_strftime(
"%d %b %Y", localtime($user->{last_bounce})
),
type => $user->{bounce_class},
};
}
}
}
return 1;
 
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment