Dear Gitlab users, due to maintenance reasons, Gitlab will not be available on Thursday 30.09.2021 from 5:00 pm to approximately 5:30 pm.

Commit 4c661018 authored by felix.herrmann's avatar felix.herrmann
Browse files

Merge branch '181-e-mail-notification-dashboard' into 'master'

Resolve "E-Mail notification & dashboard"

Closes #181

See merge request !392
parents af02f78a 0e8805af
......@@ -119,11 +119,14 @@ def send_update_email(subject, message, email_to):
# message_html = render_to_string(
# "core/email.html", {"message": message, "subject": subject, "html": True, }
# )
send_mail(
subject_prefixed,
message_text,
email_from,
email_to,
fail_silently=False,
# html_message=message_html
)
try:
send_mail(
subject_prefixed,
message_text,
email_from,
email_to,
fail_silently=False,
# html_message=message_html
)
except Exception as e:
logger.error(e)
......@@ -478,6 +478,7 @@ class DataSetAccessRequest(models.Model):
)
notification.save()
self.notification = notification
logger.error("[DataSetAccessRequest] send mail")
# send email to dataset owner
subject = text
message = _(
......@@ -487,8 +488,9 @@ class DataSetAccessRequest(models.Model):
)
email_to = [self.dataset.owner.get_email()]
send_update_email(subject, message, email_to)
logger.error("[DataSetAccessRequest] save")
models.Model.save(self, *args, **kwargs)
logger.error("[DataSetAccessRequest] saved")
def __str__(self):
ar_string = "Access request pending since {}".format(
......@@ -519,6 +521,7 @@ class DataSetPublicationRequest(models.Model):
notification_type=Notification.PUB_REQUEST,
)
notification.save()
self.notification = notification
# send email to all curators
subject = "[Curation] {}".format(text,)
......@@ -527,10 +530,13 @@ class DataSetPublicationRequest(models.Model):
self.dataset, self.category, self.dataset.get_absolute_url_curation()
)
)
logger.debug(self.category.get_curators_emails())
logger.error("[DataSetPublicationRequest]", self.category.get_curators_emails())
email_to = self.category.get_curators_emails()
logger.error("[DataSetPublicationRequest] send mail")
send_update_email(subject, message, email_to)
logger.error("[DataSetPublicationRequest] save")
models.Model.save(self, *args, **kwargs)
logger.error("[DataSetPublicationRequest] saved")
def __str__(self):
ar_string = "Publication request for {} by {} pending since {}".format(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment