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.""")
评论列表
文章目录