From 50c46c4d3a697ef0af80576f6e336c4b92e86398 Mon Sep 17 00:00:00 2001 From: Teymour Aldridge Date: Thu, 19 Dec 2024 21:20:32 +0100 Subject: [PATCH] Add missing csrf token to "set breaking" button. --- tabbycat/templates/ajax/AjaxMixin.vue | 20 +++---------------- tabbycat/templates/ajax/CookieMixin.vue | 20 +++++++++++++++++++ .../tables/CheckboxTablesContainer.vue | 7 ++++++- 3 files changed, 29 insertions(+), 18 deletions(-) create mode 100644 tabbycat/templates/ajax/CookieMixin.vue diff --git a/tabbycat/templates/ajax/AjaxMixin.vue b/tabbycat/templates/ajax/AjaxMixin.vue index 5bb471ef2e5..c2d32a2c24e 100644 --- a/tabbycat/templates/ajax/AjaxMixin.vue +++ b/tabbycat/templates/ajax/AjaxMixin.vue @@ -1,8 +1,9 @@ diff --git a/tabbycat/templates/tables/CheckboxTablesContainer.vue b/tabbycat/templates/tables/CheckboxTablesContainer.vue index 8edb72a8793..e299101be62 100644 --- a/tabbycat/templates/tables/CheckboxTablesContainer.vue +++ b/tabbycat/templates/tables/CheckboxTablesContainer.vue @@ -28,6 +28,7 @@
@@ -77,9 +78,10 @@ import _ from 'lodash' import AutoSaveCounter from '../../templates/allocations/AutoSaveCounter.vue' import TablesContainer from './TablesContainer.vue' import AjaxMixin from '../ajax/AjaxMixin.vue' +import CookieMixin from '../ajax/CookieMixin.vue' export default { - mixins: [AjaxMixin], + mixins: [AjaxMixin, CookieMixin], components: { AutoSaveCounter, TablesContainer }, props: { tablesData: Array, @@ -111,6 +113,9 @@ export default { }) return checked }, + csrftoken: function () { + return this.getCookie('csrftoken') + }, }, methods: { saveChecks: function (type) {