mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-30 15:09:47 +00:00
added whitelist check
This commit is contained in:
@@ -1,19 +1,22 @@
|
||||
import webnotes
|
||||
from webnotes.utils import load_json, cstr, now
|
||||
|
||||
# update the editable text item
|
||||
@webnotes.whitelist()
|
||||
def update_item(args):
|
||||
args = load_json(args)
|
||||
|
||||
webnotes.conn.sql("update `tab%s` set `%s`=%s, modified=%s where name=%s" \
|
||||
% (args['dt'], args['fn'], '%s', '%s', '%s'), (args['text'], now(), args['dn']))
|
||||
|
||||
|
||||
@webnotes.whitelist()
|
||||
def has_answered(arg):
|
||||
return webnotes.conn.sql("select name from tabAnswer where owner=%s and question=%s", (webnotes.user.name, arg)) and 'Yes' or 'No'
|
||||
|
||||
@webnotes.whitelist()
|
||||
def get_question(arg):
|
||||
return cstr(webnotes.conn.sql("select question from tabQuestion where name=%s", arg)[0][0])
|
||||
|
||||
@webnotes.whitelist()
|
||||
def add_answer(args):
|
||||
args = load_json(args)
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import webnotes
|
||||
from webnotes.utils import load_json, cint, cstr
|
||||
|
||||
# add a new question
|
||||
@webnotes.whitelist()
|
||||
def add_question(arg):
|
||||
args = load_json(arg)
|
||||
|
||||
@@ -22,7 +23,7 @@ def add_question(arg):
|
||||
'notify': 1
|
||||
})
|
||||
|
||||
|
||||
@webnotes.whitelist()
|
||||
def vote(arg):
|
||||
args = load_json(arg)
|
||||
|
||||
@@ -36,6 +37,7 @@ def vote(arg):
|
||||
|
||||
return p
|
||||
|
||||
@webnotes.whitelist()
|
||||
def delete(arg):
|
||||
"""
|
||||
delete a question or answer (called from kb toolbar)
|
||||
|
||||
Reference in New Issue
Block a user