Skip to content

Commit

Permalink
Add ingest logs link to email templates
Browse files Browse the repository at this point in the history
  • Loading branch information
abought committed Dec 17, 2019
1 parent 5fa39e9 commit 8532cd9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions locuszoom_plotting_service/taskapp/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from django.db.models import signals
from django.db import transaction
from django.dispatch import receiver
from django.urls import reverse
from django.utils import timezone

from zorp import (
Expand Down Expand Up @@ -156,8 +157,9 @@ def mark_success(self, fileset_id):
metadata.save()

# TODO: Render this as a nicer-looking template
log_url = reverse('gwas:gwas-ingest-log', kwargs={'slug': metadata.slug})
send_mail('[locuszoom] Upload succeeded',
f'Your upload is done processing. Please visit https://{settings.LZ_OFFICIAL_DOMAIN}{metadata.get_absolute_url()} to see the Manhattan plot and begin exploring regions of your data.', # noqa
f'Your upload is done processing. Please visit https://{settings.LZ_OFFICIAL_DOMAIN}{metadata.get_absolute_url()} to see the Manhattan plot and begin exploring regions of your data.\nBe sure to review the ingest logs for any warnings: https://{settings.LZ_OFFICIAL_DOMAIN}{log_url}', # noqa
'[email protected]',
[metadata.owner.email])

Expand All @@ -176,8 +178,9 @@ def mark_failure(self, fileset_id):
instance.save()

metadata = instance.metadata
log_url = reverse('gwas:gwas-ingest-log', kwargs={'slug': metadata.slug})
send_mail('[locuszoom] Upload failed',
f'Your upload failed to process. Please visit https://{settings.LZ_OFFICIAL_DOMAIN}{metadata.get_absolute_url()} to see the error logs.', # noqa
f'Your upload failed to process. Please review the ingest logs for warnings and error messages: https://{settings.LZ_OFFICIAL_DOMAIN}{log_url}\nOr visit the upload page to change settings: https://{settings.LZ_OFFICIAL_DOMAIN}{metadata.get_absolute_url()}', # noqa
'[email protected]',
[metadata.owner.email])

Expand Down

0 comments on commit 8532cd9

Please sign in to comment.