# HG changeset patch # User Sylvain Thénault # Date 1251266646 -7200 # Node ID 09ab5e93a02ca1d7a27267f6f1ee1b6034c566b5 # Parent 74e842e4871aa2b3764b09ab14531454b7ff8e54 [notification] fix #103822, don't try to wrap text/rest to 80 characters diff -r 74e842e4871a -r 09ab5e93a02c sobjects/notification.py --- a/sobjects/notification.py Tue Aug 25 23:52:07 2009 +0200 +++ b/sobjects/notification.py Wed Aug 26 08:04:06 2009 +0200 @@ -76,9 +76,10 @@ except RegistryException: return comment = entity.printable_value('comment', format='text/plain') - if comment: - comment = normalize_text(comment, 80, - rest=entity.comment_format=='text/rest') + # XXX don't try to wrap rest until we've a proper transformation (see + # #103822) + if comment and entity.comment_format != 'text/rest': + comment = normalize_text(comment, 80) RenderAndSendNotificationView(session, view=view, viewargs={ 'comment': comment, 'previous_state': entity.previous_state.name, 'current_state': entity.new_state.name}) @@ -175,8 +176,12 @@ entity = self.entity(self.row or 0, self.col or 0) content = entity.printable_value(self.content_attr, format='text/plain') if content: - contentformat = getattr(entity, self.content_attr + '_format', 'text/rest') - content = normalize_text(content, 80, rest=contentformat=='text/rest') + contentformat = getattr(entity, self.content_attr + '_format', + 'text/rest') + # XXX don't try to wrap rest until we've a proper transformation (see + # #103822) + if contentformat != 'text/rest': + content = normalize_text(content, 80) return super(ContentAddedView, self).context(content=content, **kwargs) def subject(self):