From ce862a3bde60f7a1437e8b0d33e7dfd95e9d4b3f Mon Sep 17 00:00:00 2001 From: Hugo Levy-Falk Date: Mon, 4 Nov 2019 17:49:17 +0100 Subject: [PATCH] =?UTF-8?q?What=20Is=20Dead=20May=20Never=20Die=20?= =?UTF-8?q?=F0=9F=A7=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- users/management/commands/email.py | 35 ------------------------------ 1 file changed, 35 deletions(-) delete mode 100644 users/management/commands/email.py diff --git a/users/management/commands/email.py b/users/management/commands/email.py deleted file mode 100644 index 5e1d02c4..00000000 --- a/users/management/commands/email.py +++ /dev/null @@ -1,35 +0,0 @@ -from django.core.management.base import BaseCommand, CommandError - -from datetime import datetime, timedelta -from pytz - -from users.models import User - -UTC = pytz.timezone('UTC') - - -# TODO : remove of finsihed this because currently it should -# be failing! Who commited that ?! -class Command(BaseCommand): - commands = ['email_remainder'] - args = '[command]' - help = 'Send email remainders' - - def handle(self, *args, **options): - ''' - Sends an email before the end of a user's subscription - ''' - users = User.objects.filter(state="STATE_ACTIVE") - - for user in users: - remaining = user.end_adhesion() - datetime.today(tz=UTC) - if (timedelta(weeks=4) - remaining).days == 1: - 4_weeks_reminder() - elif (timedelta(weeks=1) - remaining).days == 1: - week_reminder() - elif remaining.days == 1: - last_day_reminder() - - -def month_reminder(): - pass