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()