[blog] permission fix
This commit is contained in:
parent
51f688ad4a
commit
b840296925
@ -71,17 +71,18 @@ def add_comment(args=None):
|
|||||||
page_name = args.get("page_name")
|
page_name = args.get("page_name")
|
||||||
if "page_name" in args:
|
if "page_name" in args:
|
||||||
del args["page_name"]
|
del args["page_name"]
|
||||||
|
if "cmd" in args:
|
||||||
|
del args["cmd"]
|
||||||
|
|
||||||
comment = webnotes.bean(args)
|
comment = webnotes.bean(args)
|
||||||
del comment.doc.fields["cmd"]
|
|
||||||
comment.ignore_permissions = True
|
comment.ignore_permissions = True
|
||||||
comment.insert()
|
comment.insert()
|
||||||
|
|
||||||
# since comments are embedded in the page, clear the web cache
|
# since comments are embedded in the page, clear the web cache
|
||||||
webnotes.webutils.clear_cache(page_name)
|
webnotes.webutils.clear_cache(page_name)
|
||||||
|
|
||||||
comment['comment_date'] = webnotes.utils.global_date_format(comment['creation'])
|
args['comment_date'] = webnotes.utils.global_date_format(comment['creation'])
|
||||||
template_args = { 'comment_list': [comment], 'template': 'app/website/templates/html/comment.html' }
|
template_args = { 'comment_list': [args], 'template': 'app/website/templates/html/comment.html' }
|
||||||
|
|
||||||
# get html of comment row
|
# get html of comment row
|
||||||
comment_html = webnotes.webutils.build_html(template_args)
|
comment_html = webnotes.webutils.build_html(template_args)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user