error fixed in adding answer in knowledge base
This commit is contained in:
parent
0af1959a63
commit
5f91862aef
@ -94,7 +94,8 @@ KBQuestionView = function(w, qid, qtext) {
|
||||
var v = $(me.input).val();
|
||||
if(!v) { msgprint('Write something!'); return; }
|
||||
me.btn.set_working();
|
||||
$c_page('utilities', 'question_view', 'add_answer', {qid: qid, answer:v},
|
||||
$c_page('utilities', 'question_view', 'add_answer',
|
||||
JSON.stringify({qid: qid, "answer":v}),
|
||||
function(r, rt) {
|
||||
me.btn.done_working();
|
||||
me.ans_list.list.run();
|
||||
|
@ -34,15 +34,14 @@ 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)
|
||||
def add_answer(arg):
|
||||
arg = load_json(arg)
|
||||
|
||||
from webnotes.model.doc import Document
|
||||
|
||||
a = Document('Answer')
|
||||
a.answer = args['answer']
|
||||
a.question = args['qid']
|
||||
a.answer = arg['answer']
|
||||
a.question = arg['qid']
|
||||
a.points = 1
|
||||
a.save(1)
|
||||
|
||||
webnotes.conn.set_value('Question', args['qid'], 'modified', now())
|
||||
webnotes.conn.set_value('Question', arg['qid'], 'modified', now())
|
Loading…
x
Reference in New Issue
Block a user