tasks.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:imagery 作者: cenima-ibama 项目源码 文件源码
def not_found_scenes_alert():
    """Send email if there are Scene Requests that were not found in AWS and
    Google Earth servers and need manual download.
    """
    yesterday = date.today() - timedelta(days=1)
    if SceneRequest.objects.filter(status='not_found',
        creation_date__gte=yesterday).count() > 0:
        try:
            send_multipart_email(
                subject='Not Found Scene Requests',
                html_template='imagery/email_not_found_scenerequests.html',
                from_email=settings.SERVER_EMAIL,
                to_email=settings.NOT_FOUND_SCENES_ADMIN_EMAILS
                )
        except AttributeError:

            logger.error(
                """There are scene requests that require manual download but we
                could not send email because the variables SERVER_EMAIL or
                NOT_FOUND_SCENES_ADMIN_EMAILS are not configured in your
                settings.""")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号