comparison rhodecode/model/notification.py @ 1732:8321b3d19b1f beta

test fixes
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 26 Nov 2011 21:50:08 +0200
parents 31e6eb2fb4b2
children 025f3333c769
comparison
equal deleted inserted replaced
1731:31e6eb2fb4b2 1732:8321b3d19b1f
179 return tmpl % data 179 return tmpl % data
180 180
181 181
182 class EmailNotificationModel(BaseModel): 182 class EmailNotificationModel(BaseModel):
183 183
184 TYPE_CHANGESET_COMMENT = 'changeset_comment' 184 TYPE_CHANGESET_COMMENT = Notification.TYPE_CHANGESET_COMMENT
185 TYPE_PASSWORD_RESET = 'passoword_link' 185 TYPE_PASSWORD_RESET = 'passoword_link'
186 TYPE_REGISTRATION = 'registration' 186 TYPE_REGISTRATION = Notification.TYPE_REGISTRATION
187 TYPE_DEFAULT = 'default' 187 TYPE_DEFAULT = 'default'
188 188
189 def __init__(self): 189 def __init__(self):
190 self._template_root = rhodecode.CONFIG['pylons.paths']['templates'][0] 190 self._template_root = rhodecode.CONFIG['pylons.paths']['templates'][0]
191 self._tmpl_lookup = rhodecode.CONFIG['pylons.app_globals'].mako_lookup 191 self._tmpl_lookup = rhodecode.CONFIG['pylons.app_globals'].mako_lookup
202 return generated template for email based on given type 202 return generated template for email based on given type
203 203
204 :param type_: 204 :param type_:
205 """ 205 """
206 206
207 base = self.email_types.get(type_, self.TYPE_DEFAULT) 207 base = self.email_types.get(type_, self.email_types[self.TYPE_DEFAULT])
208 email_template = self._tmpl_lookup.get_template(base) 208 email_template = self._tmpl_lookup.get_template(base)
209 # translator inject 209 # translator inject
210 _kwargs = {'_':_} 210 _kwargs = {'_':_}
211 _kwargs.update(kwargs) 211 _kwargs.update(kwargs)
212 log.debug('rendering tmpl %s with kwargs %s' % (base, _kwargs)) 212 log.debug('rendering tmpl %s with kwargs %s' % (base, _kwargs))