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.
 
 
 
 
 
 

32 lines
936 B

from django.core.management.base import BaseCommand
from apps.notification.tasks import send_camp_certificates
class Command(BaseCommand):
help = 'Send camp certificates at the end of month'
def add_arguments(self, parser):
# Named (optional) arguments
parser.add_argument(
'--email',
dest='email',
help='Test email',
)
parser.add_argument(
'--cert',
dest='certificate_number',
type=int,
help='Certificate number',
)
parser.add_argument(
'--dry-run',
action='store_true',
dest='dry_run',
help='Only display emails',
)
def handle(self, *args, **options):
send_camp_certificates(email=options.get('email'), certificate_number=options.get('certificate_number'),
dry_run=options.get('dry_run'))