Mercurial > kallithea
comparison rhodecode/model/notification.py @ 2156:a27e4d44237e beta
Use __unicode__ instead of __repr__ in models.
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 22 Mar 2012 02:44:42 +0200 |
parents | 50aa7cb78cfe |
children | 76947224bf27 7d517a35b6c9 |
comparison
equal
deleted
inserted
replaced
2155:24d906650cc0 | 2156:a27e4d44237e |
---|---|
110 email_body = body | 110 email_body = body |
111 kwargs = {'subject': subject, 'body': h.rst_w_mentions(body)} | 111 kwargs = {'subject': subject, 'body': h.rst_w_mentions(body)} |
112 kwargs.update(email_kwargs) | 112 kwargs.update(email_kwargs) |
113 email_body_html = EmailNotificationModel()\ | 113 email_body_html = EmailNotificationModel()\ |
114 .get_email_tmpl(type_, **kwargs) | 114 .get_email_tmpl(type_, **kwargs) |
115 | |
115 run_task(tasks.send_email, rec.email, email_subject, email_body, | 116 run_task(tasks.send_email, rec.email, email_subject, email_body, |
116 email_body_html) | 117 email_body_html) |
117 | 118 |
118 return notif | 119 return notif |
119 | 120 |
181 if show_age: | 182 if show_age: |
182 when = h.age(notification.created_on) | 183 when = h.age(notification.created_on) |
183 else: | 184 else: |
184 DTF = lambda d: datetime.datetime.strftime(d, DATETIME_FORMAT) | 185 DTF = lambda d: datetime.datetime.strftime(d, DATETIME_FORMAT) |
185 when = DTF(notification.created_on) | 186 when = DTF(notification.created_on) |
187 | |
186 data = dict( | 188 data = dict( |
187 user=notification.created_by_user.username, | 189 user=notification.created_by_user.username, |
188 action=_map[notification.type_], when=when, | 190 action=_map[notification.type_], when=when, |
189 ) | 191 ) |
190 return tmpl % data | 192 return tmpl % data |