treenode | fix CSRF token and saving text.

This commit is contained in:
Tomas 'Jethro' Pokorny 2020-11-03 20:27:20 +01:00
parent 4de974cec0
commit 73a84002d1
2 changed files with 2 additions and 0 deletions

View file

@ -74,6 +74,7 @@ class TextNodeWriteSerializer(serializers.ModelSerializer):
def update(self,node,validated_data):
node.text.na_web = validated_data.get('text').get('na_web')
node.text.save()
return node
class Meta:

View file

@ -88,6 +88,7 @@ export default {
mounted: function() {
//console.log("mounted");
this.editorConfig.simpleUpload.headers['X-CSRFToken'] = this.getCookie('csrftoken');
axios.defaults.headers.common['X-CSRFToken'] = this.getCookie('csrftoken');
if (this.create){
this.currentText = "";
this.originalText = "";