diff --git a/website/views.py b/website/views.py index 001c3c5..fac9074 100644 --- a/website/views.py +++ b/website/views.py @@ -187,32 +187,33 @@ def process_Spam(content_body, is_spam): def send_remider_mail(): - if date.today().weekday() == 1 or date.today().weekday() == 3: - # check in the database for last mail sent date - try: - is_mail_sent = Scheduled_Auto_Mail.objects.get( - pk=1, is_sent=1, is_active=1) - sent_date = is_mail_sent.mail_sent_date - except Scheduled_Auto_Mail.DoesNotExist: - sent_date = None - now = datetime.now() - date_string = now.strftime("%Y-%m-%d") - if sent_date == date_string: - print("***** Mail already sent on ", sent_date, " *****") - pass - else: - auto_clean_spam() - a = Cron() - a.unanswered_notification() - Scheduled_Auto_Mail.objects.get_or_create(id=1, defaults=dict( - mail_sent_date=date_string, is_sent=1, is_active=1)) - Scheduled_Auto_Mail.objects.filter( - is_sent=1).update( - mail_sent_date=date_string) - print("***** New Notification Mail sent *****") - a.train_spam_filter() - else: - print("***** Mail not sent *****") + pass + # if date.today().weekday() == 1 or date.today().weekday() == 3: + # # check in the database for last mail sent date + # try: + # is_mail_sent = Scheduled_Auto_Mail.objects.get( + # pk=1, is_sent=1, is_active=1) + # sent_date = is_mail_sent.mail_sent_date + # except Scheduled_Auto_Mail.DoesNotExist: + # sent_date = None + # now = datetime.now() + # date_string = now.strftime("%Y-%m-%d") + # if sent_date == date_string: + # print("***** Mail already sent on ", sent_date, " *****") + # pass + # else: + # auto_clean_spam() + # a = Cron() + # a.unanswered_notification() + # Scheduled_Auto_Mail.objects.get_or_create(id=1, defaults=dict( + # mail_sent_date=date_string, is_sent=1, is_active=1)) + # Scheduled_Auto_Mail.objects.filter( + # is_sent=1).update( + # mail_sent_date=date_string) + # print("***** New Notification Mail sent *****") + # a.train_spam_filter() + # else: + # print("***** Mail not sent *****") # VIEWS FUNCTIONS @@ -2177,4 +2178,4 @@ def ban_user(request, user_id): user = User.objects.get(id=user_id) user.is_active = False user.save() - return HttpResponseRedirect("/accounts/view-profile/{0}/".format(user.id)) \ No newline at end of file + return HttpResponseRedirect("/accounts/view-profile/{0}/".format(user.id))