瀏覽代碼

[fix] set comment by fullname if missing

version-14
Anand Doshi 10 年之前
父節點
當前提交
746043ba30
共有 1 個檔案被更改,包括 4 行新增0 行删除
  1. +4
    -0
      frappe/core/doctype/comment/comment.py

+ 4
- 0
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()


Loading…
取消
儲存