|
1 | 1 | from datetime import datetime, timezone, timedelta |
2 | | -from django.db.models import Q, F, ExpressionWrapper, DurationField, Sum |
3 | | -from django.db.models.query import QuerySet |
4 | 2 | from django.core.management.base import BaseCommand |
5 | | -from django.contrib.auth.models import User |
6 | | -from django.conf import settings |
7 | 3 | from django.template.loader import render_to_string |
8 | | -from elasticsearch.helpers import bulk |
9 | | -from utils.elasticsearch import construct_es_data |
10 | | -from api.esconnection import ES_CLIENT |
11 | | -from api.models import UserRegion, Region, Event, ActionsTaken, CronJob, CronJobStatus, Profile |
12 | | -from api.logger import logger |
13 | | -from notifications.models import RecordType, SubscriptionType, Subscription, SurgeAlert |
14 | | -from notifications.hello import get_hello |
15 | | -from notifications.notification import send_notification |
16 | | -from deployments.models import PersonnelDeployment, ERU, Personnel |
17 | | -from main.frontend import frontend_url |
| 4 | +from api.models import UserRegion, Region |
18 | 5 | from registrations.models import Pending |
19 | 6 | from notifications.notification import send_notification |
20 | | -import html |
21 | | - |
22 | | - |
23 | | -time_3_day = timedelta(days=3) |
24 | | - |
25 | 7 |
|
26 | 8 |
|
27 | 9 | class Command(BaseCommand): |
28 | 10 | help = 'Send reminder about the pending registrations' |
29 | 11 |
|
30 | 12 | def diff_3_day(self): |
31 | | - return datetime.utcnow().replace(tzinfo=timezone.utc) - time_3_day |
| 13 | + return datetime.utcnow().replace(tzinfo=timezone.utc) - timedelta(days=3) |
32 | 14 |
|
33 | 15 | def handle(self, *args, **options): |
34 | 16 | region_ids = Region.objects.all().values_list('id', flat=True) |
|
0 commit comments