Commit 2460a7d2 authored by chirac's avatar chirac

Merge branch '229-kill-dead-code' into 'dev'

What Is Dead May Never Die 馃

See merge request federez/re2o!467
parents 180ba11a ce862a3b
Pipeline #2300 passed with stage
in 4 minutes and 57 seconds
from 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() -
if (timedelta(weeks=4) - remaining).days == 1:
elif (timedelta(weeks=1) - remaining).days == 1:
elif remaining.days == 1:
def month_reminder():
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