From b85b2a16e5d06be4b1d666ea24740d45bdfaa049 Mon Sep 17 00:00:00 2001 From: jordan Date: Sun, 27 Mar 2011 19:51:36 +0000 Subject: [PATCH] OSQA-236, modifying the flagged content daily digest, now we count only the items that have been flagged for the last 24 hours. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@902 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/management/commands/send_email_alerts.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/forum/management/commands/send_email_alerts.py b/forum/management/commands/send_email_alerts.py index 02e2df0..80159e7 100644 --- a/forum/management/commands/send_email_alerts.py +++ b/forum/management/commands/send_email_alerts.py @@ -12,8 +12,6 @@ SHOW_N_MORE_ACTIVE_NEW_MEMBERS = 5 SUB_QUESTION_LIST_LENGTH = 5 TRY_N_USER_TAGS = 5 - - class DigestQuestionsIndex(object): def __init__(self, from_date): self.from_date = from_date @@ -99,7 +97,7 @@ class Command(NoArgsCommand): new_member_count = new_members.count() # The number of the flagged content for the day - flagged_count = Flag.objects.all().count() + flagged_count = Flag.objects.filter(flagged_at__gt=datetime.datetime.today()-datetime.timedelta(days=1)).count() if new_member_count >= SHOW_N_MORE_ACTIVE_NEW_MEMBERS: new_members = new_members[:SHOW_N_MORE_ACTIVE_NEW_MEMBERS] -- 2.39.5