X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/3c31ffa63cb6caab17b6edd7c45e76169c01541a..52b732386eaabbe2d99e3b13ad680ab06bdc4c47:/forum/management/commands/send_email_alerts.py diff --git a/forum/management/commands/send_email_alerts.py b/forum/management/commands/send_email_alerts.py index 85b83fa..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 @@ -98,6 +96,9 @@ class Command(NoArgsCommand): new_member_count = new_members.count() + # The number of the flagged content for the day + 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] show_all_users = True