sendvacancyexpirationnotification.py 673 Bytes
Newer Older
1
2
3
4
5
6
from django.core.management.base import BaseCommand

from partners import emails


class Command(BaseCommand):
7
    """Command class for sendvacancyexpirationnotification command."""
8
9

    def add_arguments(self, parser):
10
        """Add --dry-run argument to command."""
11
12
13
14
15
16
17
18
19
        parser.add_argument(
            '--dry-run',
            action='store_true',
            dest='dry-run',
            default=False,
            help='Dry run instead of sending e-mail',
        )

    def handle(self, *args, **options):
20
        """Call the function to handle the sending of emails."""
21
22
        emails.send_vacancy_expiration_notifications(
            bool(options['dry-run']))