Use unicode for logging comments
The comment problems detailed in issue 791 are related to logging of comments creation. The log tries to format unicode comments into an ascii string (that is the unicode comment content). This also creates problems with mark seen functionality since that also logs the comments which breaks and you end up with a lot of international comments in your message queue. This commit makes both log messages unicode as well as the representation of the comment.
This commit is contained in:
parent
8c311def96
commit
09bed9a732
@ -295,7 +295,7 @@ class MediaCommentMixin(object):
|
|||||||
return cleaned_markdown_conversion(self.content)
|
return cleaned_markdown_conversion(self.content)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return '<{klass} #{id} {author} "{comment}">'.format(
|
return u'<{klass} #{id} {author} "{comment}">'.format(
|
||||||
klass=self.__class__.__name__,
|
klass=self.__class__.__name__,
|
||||||
id=self.id,
|
id=self.id,
|
||||||
author=self.get_author,
|
author=self.get_author,
|
||||||
|
@ -666,7 +666,7 @@ class Notification(Base):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return '<{klass} #{id}: {user}: {subject} ({seen})>'.format(
|
return u'<{klass} #{id}: {user}: {subject} ({seen})>'.format(
|
||||||
id=self.id,
|
id=self.id,
|
||||||
klass=self.__class__.__name__,
|
klass=self.__class__.__name__,
|
||||||
user=self.user,
|
user=self.user,
|
||||||
|
@ -65,7 +65,7 @@ def mark_comment_notification_seen(comment_id, user):
|
|||||||
user_id=user.id,
|
user_id=user.id,
|
||||||
subject_id=comment_id).first()
|
subject_id=comment_id).first()
|
||||||
|
|
||||||
_log.debug('Marking {0} as seen.'.format(notification))
|
_log.debug(u'Marking {0} as seen.'.format(notification))
|
||||||
|
|
||||||
mark_notification_seen(notification)
|
mark_notification_seen(notification)
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ class EmailNotificationTask(Task):
|
|||||||
'''
|
'''
|
||||||
def run(self, notification_id, message):
|
def run(self, notification_id, message):
|
||||||
cn = CommentNotification.query.filter_by(id=notification_id).first()
|
cn = CommentNotification.query.filter_by(id=notification_id).first()
|
||||||
_log.info('Sending notification email about {0}'.format(cn))
|
_log.info(u'Sending notification email about {0}'.format(cn))
|
||||||
|
|
||||||
return send_email(
|
return send_email(
|
||||||
message['from'],
|
message['from'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user