|
|
|
@ -42,6 +42,11 @@ def check_license(): |
|
|
|
|
|
|
|
|
|
|
|
@shared_task |
|
|
|
@shared_task |
|
|
|
def delete_not_activated_users(): |
|
|
|
def delete_not_activated_users(): |
|
|
|
|
|
|
|
""" |
|
|
|
|
|
|
|
Delete not activated users in 5 days after sending |
|
|
|
|
|
|
|
the application for registration |
|
|
|
|
|
|
|
:return: None |
|
|
|
|
|
|
|
""" |
|
|
|
today = timezone.now().date() |
|
|
|
today = timezone.now().date() |
|
|
|
date_join = today - timezone.timedelta(days=5) |
|
|
|
date_join = today - timezone.timedelta(days=5) |
|
|
|
users = DokUser.objects.filter(profile__active=False, profile__confirmed=False).\ |
|
|
|
users = DokUser.objects.filter(profile__active=False, profile__confirmed=False).\ |
|
|
|
@ -59,10 +64,15 @@ def delete_not_activated_users(): |
|
|
|
|
|
|
|
|
|
|
|
@shared_task |
|
|
|
@shared_task |
|
|
|
def send_offer_for_get_bonus(): |
|
|
|
def send_offer_for_get_bonus(): |
|
|
|
|
|
|
|
""" |
|
|
|
|
|
|
|
Sending a proposal with a bonus to new users without the purchased license |
|
|
|
|
|
|
|
on the 9th day after registration |
|
|
|
|
|
|
|
:return: list of users(for testing) |
|
|
|
|
|
|
|
""" |
|
|
|
user_list = [] |
|
|
|
user_list = [] |
|
|
|
today = timezone.now().date() |
|
|
|
today = timezone.now().date() |
|
|
|
date_join_start = today - timezone.timedelta(days=5) |
|
|
|
date_join_start = today - timezone.timedelta(days=9) |
|
|
|
date_join_end = today - timezone.timedelta(days=4) |
|
|
|
date_join_end = today - timezone.timedelta(days=8) |
|
|
|
users = DokUser.objects.filter(profile__active=True, profile__confirmed=True).\ |
|
|
|
users = DokUser.objects.filter(profile__active=True, profile__confirmed=True).\ |
|
|
|
filter(date_joined__gt=date_join_start, date_joined__lt=date_join_end) |
|
|
|
filter(date_joined__gt=date_join_start, date_joined__lt=date_join_end) |
|
|
|
|
|
|
|
|
|
|
|
|