From 746043ba30d6cd6ab2eb3edf30a633ea6356f97f Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 11 Jun 2015 00:50:51 -0400 Subject: [PATCH] [fix] set comment by fullname if missing --- frappe/core/doctype/comment/comment.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frappe/core/doctype/comment/comment.py b/frappe/core/doctype/comment/comment.py index 76f7532a2b..57e688a8f6 100644 --- a/frappe/core/doctype/comment/comment.py +++ b/frappe/core/doctype/comment/comment.py @@ -7,6 +7,7 @@ from frappe import _ from frappe.website.render import clear_cache from frappe.model.document import Document from frappe.model.db_schema import add_column +from frappe.utils import get_fullname class Comment(Document): """Comments are added to Documents via forms or views like blogs etc.""" @@ -38,6 +39,9 @@ class Comment(Document): and comment_docname=%s""", (self.doctype, self.name))[0][0] >= 50: frappe.throw(_("Cannot add more than 50 comments")) + if not self.comment_by_fullname and self.comment_by: + self.comment_by_fullname = get_fullname(self.comment_by) + def on_update(self): """Updates `_comments` property in parent Document.""" self.update_comment_in_doc()