You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 lines
844 B

from django.core.management.base import BaseCommand
from apps.notification.tasks import send_certificates
class Command(BaseCommand):
help = 'Send certificates at the end of subscription'
def add_arguments(self, parser):
# Named (optional) arguments
parser.add_argument(
'--email',
dest='email',
help='Test email',
)
parser.add_argument(
'--date',
dest='date',
help='Date in format 22-03-2018',
)
parser.add_argument(
'--dry-run',
action='store_true',
dest='dry_run',
help='Only display emails',
)
def handle(self, *args, **options):
send_certificates(email=options.get('email'), date_end=options.get('date'), dry_run=options.get('dry_run'))