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.

31 lines
935 B

  1. from datetime import date
  2. from django.core.management.base import BaseCommand, CommandError
  3. # from django.db.models.query import QuerySet
  4. from input.models import Project
  5. class Command(BaseCommand):
  6. ''' mails will be send here:
  7. - two weeks after confirmation of support for volunteer (/extern) send link
  8. with surveylink
  9. - same for HonoraryCertificate and accreditation (/intern)
  10. - travel: mail 3 weeks after end of project.
  11. - assumed end of project (/project) reached: mail to IF, link to project-editpage
  12. '''
  13. help = '''This command sends mail with some links to the database or to the survey
  14. after some amount of time.'''
  15. def handle(self, *args, **options):
  16. # get all projects which ended 3 weeks ago
  17. old = Project.objects.filter(end__lt = date.today())
  18. print(old)
  19. self.stdout.write(self.style.SUCCESS('sendmails custom command executed'))