Commit 1a796f6e authored by Alice's avatar Alice

WIP: debug email send.

parent 21e29eba
......@@ -233,8 +233,6 @@ class BrokenLink(Model):
container_path = 'brokenlinks/'
rdf_type = 'coopstarter:brokenlinks'
def __str__(self):
return self.user.get_full_name()
@receiver(post_save, sender=Resource)
def create_review(sender, instance, created, **kwargs):
......@@ -306,17 +304,17 @@ def update_review(sender, instance, created, **kwargs):
@receiver(post_save, sender=BrokenLink)
def sendMailToResourceSubmitter(sender, instance, created, **kwargs):
if created:
if instance:
brokenLink = instance
message = loader.render_to_string(
'report_broken_link.txt',
{
'brokenlink': instance,
}
)
send_mail(
'The resource you submitted has a brokenlink',
message,
brokenLink.resource.submitter.email,
[brokenLink.resource.submitter.email]
print(instance.resource.submitter.email)
message = loader.render_to_string(
'report_broken_link.txt',
{
'brokenlink': instance,
}
)
print(message)
send_mail(
'The resource you submitted has a brokenlink',
message,
instance.resource.submitter.email,
[instance.resource.submitter.email]
)
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