Skip to content
Snippets Groups Projects
Commit 4c01ef39 authored by Matthieu Fesselier's avatar Matthieu Fesselier
Browse files

Merge branch 'bugfix/10-email-notif-created' into 'master'

bugfix: send email only when notif created #10

See merge request startinblox/djangoldp-packages/djangoldp-notifications!13
parents c8bb171e 3ae45a94
No related branches found
No related tags found
No related merge requests found
......@@ -74,8 +74,8 @@ def send_request(target, object_iri):
@receiver(post_save, sender=Notification)
def send_email_on_notification(sender, instance, **kwargs):
if instance.summary and settings.JABBER_DEFAULT_HOST and instance.user.email:
def send_email_on_notification(sender, instance, created, **kwargs):
if created and instance.summary and settings.JABBER_DEFAULT_HOST and instance.user.email:
html_message = loader.render_to_string(
'email.html',
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment