mirror of
https://github.com/haiwen/seahub.git
synced 2025-07-21 02:20:17 +00:00
* Email unregistered user when sharing repo. * Add email to contacts when share repo/file and add group user. * Remove org repo share link.
19 lines
473 B
Python
19 lines
473 B
Python
from signals import mail_sended
|
|
|
|
from models import Contact
|
|
def mail_sended_cb(sender, **kwargs):
|
|
"""
|
|
Callback function to add email to contacts.
|
|
"""
|
|
|
|
user = kwargs['user']
|
|
email = kwargs['email']
|
|
|
|
try:
|
|
Contact.objects.get(user_email=user, contact_email=email)
|
|
# Already in contacts list, pass.
|
|
except Contact.DoesNotExist:
|
|
# Add new contact
|
|
c = Contact(user_email=user, contact_email=email)
|
|
c.save()
|