1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-24 21:07:17 +00:00

Modify org msg

This commit is contained in:
xiez
2012-09-06 16:57:54 +08:00
parent 131dc40f32
commit 4bf9851c65
7 changed files with 40 additions and 22 deletions

View File

@@ -1,4 +1,6 @@
# encoding: utf-8
import simplejson as json
from signals import org_user_added
from seahub.notifications.models import UserNotification
@@ -13,6 +15,11 @@ def org_user_added_cb(sender, **kwargs):
if not org:
return
msg = u'%s 将你加入到团体 %s' % (from_email, org.org_name)
n = UserNotification(to_user=to_email, msg_type='org_msg', detail=msg)
msg_dict = {'from_email': from_email,
'org_name': org.org_name,
'org_prefix': org.url_prefix,
'creator': org.creator}
n = UserNotification(to_user=to_email, msg_type='org_join_msg',
detail=json.dumps(msg_dict))
n.save()