判断题bug

This commit is contained in:
caoqianming 2020-03-09 11:15:08 +08:00
parent 7a13275eea
commit 6b424dd1f6
2 changed files with 2 additions and 2 deletions

View File

@ -101,7 +101,7 @@ function tmsubmitForm(){
tmdata['type'] = 3 tmdata['type'] = 3
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: 'api/question?a=add', url: 'api/question?a=edit',
data: JSON.stringify(tmdata), data: JSON.stringify(tmdata),
datatype: "json", datatype: "json",
processData: false, processData: false,

View File

@ -5697,7 +5697,7 @@ def apiquestion(req):
type = data['type'] type = data['type']
level = data['level'] level = data['level']
title = data['title'] title = data['title']
if a == 'add': if a == 'add' and 'id' in data and data['id']:
obj = Question() obj = Question()
else: else:
obj = Question.objects.get(id=data['id']) obj = Question.objects.get(id=data['id'])