.
This commit is contained in:
@@ -85,14 +85,20 @@
|
|||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
|
var $crf_token = $('[name="csrfmiddlewaretoken"]').attr('value');
|
||||||
|
/* beautify ignore:start */
|
||||||
|
n = {{ question.normal | lower }}
|
||||||
|
/* beautify ignore:end */
|
||||||
|
|
||||||
$("#toggle-normal-button").click(function () {
|
$("#toggle-normal-button").click(function () {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "{% url 'rapid-detail' question.id %}",
|
url: "{% url 'rapid-detail' question.id %}",
|
||||||
type: 'PATCH',
|
type: 'PATCH',
|
||||||
|
headers:{"X-CSRFToken": $crf_token},
|
||||||
timeout: 3000,
|
timeout: 3000,
|
||||||
data: {
|
data: {
|
||||||
csrfmiddlewaretoken: "{{ csrf_token }}",
|
csrfmiddlewaretoken: "{{ csrf_token }}",
|
||||||
normal: {{ question.normal | lower }},
|
normal: n,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.fail(function () {
|
.fail(function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user