You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The patch follows. What is left is to create the notification template.
diff --git a/friends/management.py b/friends/management.py
index 387a69c..76e8241 100644
--- a/friends/management.py
+++ b/friends/management.py
@@ -7,6 +7,7 @@ if "notification" in settings.INSTALLED_APPS:
from notification import models as notification
def create_notice_types(app, created_models, verbosity, **kwargs):
+ notification.create_notice_type("contact_joined", _("Contact Joined"), _("one of your contacts has joined the site"), default=2)
notification.create_notice_type("friends_invite", _("Invitation Received"), _("you have received an invitation"), default=2)
notification.create_notice_type("friends_invite_sent", _("Invitation Sent"), _("you have sent an invitation"), default=1)
notification.create_notice_type("friends_accept", _("Acceptance Received"), _("an invitation you sent has been accepted"), default=2)
diff --git a/friends/models.py b/friends/models.py
index 03afcd5..9ebcc9b 100644
--- a/friends/models.py
+++ b/friends/models.py
@@ -226,8 +226,10 @@ if EmailAddress:
join_invitation.save()
# notification will be covered below
for contact in Contact.objects.filter(email=instance.email):
- contact.users.add(instance.user)
- # @@@ send notification
+ if not instance.user in contact.users.all():
+ contact.users.add(instance.user)
+ if notification:
+ notification.send([contact.user], "contact_joined", {"new_user": instance.user})
# only if django-email-notification is installed
signals.post_save.connect(new_user, sender=EmailAddress)
The text was updated successfully, but these errors were encountered:
The patch follows. What is left is to create the notification template.
The text was updated successfully, but these errors were encountered: