Mercurial > kallithea
comparison rhodecode/model/notification.py @ 3423:043d3827cd88 beta
added template context into Notification templates
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 02 Mar 2013 16:27:56 +0100 |
parents | 81397bd3e77f |
children | bbe21df7ad48 |
comparison
equal
deleted
inserted
replaced
3422:b5ce72167906 | 3423:043d3827cd88 |
---|---|
26 | 26 |
27 import os | 27 import os |
28 import logging | 28 import logging |
29 import traceback | 29 import traceback |
30 | 30 |
31 from pylons import tmpl_context as c | |
31 from pylons.i18n.translation import _ | 32 from pylons.i18n.translation import _ |
32 | 33 |
33 import rhodecode | 34 import rhodecode |
34 from rhodecode.lib import helpers as h | 35 from rhodecode.lib import helpers as h |
35 from rhodecode.model import BaseModel | 36 from rhodecode.model import BaseModel |
270 | 271 |
271 base = self.email_types.get(type_, self.email_types[self.TYPE_DEFAULT]) | 272 base = self.email_types.get(type_, self.email_types[self.TYPE_DEFAULT]) |
272 email_template = self._tmpl_lookup.get_template(base) | 273 email_template = self._tmpl_lookup.get_template(base) |
273 # translator and helpers inject | 274 # translator and helpers inject |
274 _kwargs = {'_': _, | 275 _kwargs = {'_': _, |
275 'h': h} | 276 'h': h, |
277 'c': c} | |
276 _kwargs.update(kwargs) | 278 _kwargs.update(kwargs) |
277 log.debug('rendering tmpl %s with kwargs %s' % (base, _kwargs)) | 279 log.debug('rendering tmpl %s with kwargs %s' % (base, _kwargs)) |
278 return email_template.render(**_kwargs) | 280 return email_template.render(**_kwargs) |