Mercurial > kallithea
comparison rhodecode/model/notification.py @ 2077:179604334d98 beta
code garden
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 01 Mar 2012 00:30:41 +0200 |
parents | 87f0800abc7b |
children | 0e27da019f84 |
comparison
equal
deleted
inserted
replaced
2076:77d215d6121f | 2077:179604334d98 |
---|---|
83 for u in recipients: | 83 for u in recipients: |
84 obj = self.__get_user(u) | 84 obj = self.__get_user(u) |
85 if obj: | 85 if obj: |
86 recipients_objs.append(obj) | 86 recipients_objs.append(obj) |
87 recipients_objs = set(recipients_objs) | 87 recipients_objs = set(recipients_objs) |
88 log.debug('sending notifications %s to %s' % ( | |
89 type_, recipients_objs) | |
90 ) | |
88 else: | 91 else: |
89 # empty recipients means to all admins | 92 # empty recipients means to all admins |
90 recipients_objs = User.query().filter(User.admin == True).all() | 93 recipients_objs = User.query().filter(User.admin == True).all() |
91 | 94 log.debug('sending notifications %s to admins: %s' % ( |
92 notif = Notification.create(created_by=created_by_obj, subject=subject, | 95 type_, recipients_objs) |
93 body=body, recipients=recipients_objs, | 96 ) |
94 type_=type_) | 97 notif = Notification.create( |
98 created_by=created_by_obj, subject=subject, | |
99 body=body, recipients=recipients_objs, type_=type_ | |
100 ) | |
95 | 101 |
96 if with_email is False: | 102 if with_email is False: |
97 return notif | 103 return notif |
98 | 104 |
99 # send email with notification | 105 # send email with notification |