# HG changeset patch # User Mads Kiilerich # Date 2015-02-11 02:40:28 # Node ID 3078f33e13d3249c6ad39cccd940e64706ce11ed # Parent 5923d74742879b812965568475e21c3496d722a9 notification: handle unicode translations (Issue #95) Would fail with localization after 8e1491a7e3af. diff --git a/kallithea/model/notification.py b/kallithea/model/notification.py --- a/kallithea/model/notification.py +++ b/kallithea/model/notification.py @@ -35,6 +35,7 @@ from sqlalchemy.orm import joinedload, s import kallithea from kallithea.lib import helpers as h +from kallithea.lib.utils2 import safe_unicode from kallithea.model import BaseModel from kallithea.model.db import Notification, User, UserNotification from kallithea.model.meta import Session @@ -302,7 +303,7 @@ class EmailNotificationModel(BaseModel): except KeyError, e: log.error('error generating email subject for %r from %s: %s', type_, ','.join(self._subj_map.keys()), e) raise - l = [str(x) for x in [kwargs.get('status_change'), kwargs.get('closing_pr') and _('Closing')] if x] + l = [safe_unicode(x) for x in [kwargs.get('status_change'), kwargs.get('closing_pr') and _('Closing')] if x] if l: subj += ' (%s)' % (', '.join(l)) return subj