fix: string formatting

This commit is contained in:
Rushabh Mehta 2019-02-09 20:51:39 +05:30
parent a1eb5bf9b3
commit bee15006cb
2 changed files with 3 additions and 3 deletions

View file

@ -149,8 +149,8 @@ def update_comments_in_parent(reference_doctype, reference_name, _comments):
try:
# use sql, so that we do not mess with the timestamp
frappe.db.sql("""update `tab%s` set `_comments`=%s where name=%s""" % (reference_doctype,
"%s", "%s"), (json.dumps(_comments), reference_name))
frappe.db.sql("""update `tab{0}` set `_comments`=%s where name=%s""".format(reference_doctype),
(json.dumps(_comments), reference_name))
except Exception as e:
if frappe.db.is_column_missing(e) and getattr(frappe.local, 'request', None):

View file

@ -30,7 +30,7 @@ def add_comment(comment, comment_email, comment_by, reference_doctype, reference
content = (doc.content
+ "<p><a href='{0}/desk/#Form/Comment/{1}' style='font-size: 80%'>{2}</a></p>".format(frappe.utils.get_request_site_address(),
doc.name,
route, _("View Comment")))
_("View Comment")))
# notify creator
frappe.sendmail(