Browse Source

[fix] set comment by fullname if missing

version-14
Anand Doshi 10 years ago
parent
commit
746043ba30
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      frappe/core/doctype/comment/comment.py

+ 4
- 0
frappe/core/doctype/comment/comment.py View File

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


Loading…
Cancel
Save