added csrf handling to quickedit

This commit is contained in:
ichuang
2012-05-26 22:34:19 -04:00
parent 22572bf87b
commit dcc72a2a18
2 changed files with 2 additions and 0 deletions

View File

@@ -387,6 +387,7 @@ def quickedit(request, id=None):
'pxmls' : pxmls,
'phtml' : phtml,
'init_js':instance.get_init_js(),
'csrf':csrf(request)['csrf_token'],
}
result = render_to_response('quickedit.html', context)

View File

@@ -53,6 +53,7 @@ function postJSON(url, data, callback) {
<br/>
<input type="submit" value="Change Problem" name="qesubmit" />
<input type="submit" value="Revert to original" name="qesubmit" />
<input type="hidden" name="csrfmiddlewaretoken" value="${csrf}"/>
</form>
<span>${msg|n}</span>