Browse Source

treenode | fix CSRF token and saving text.

export_seznamu_prednasek
parent
commit
73a84002d1
  1. 1
      seminar/views/views_rest.py
  2. 1
      vue_frontend/src/components/TextNode.vue

1
seminar/views/views_rest.py

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

1
vue_frontend/src/components/TextNode.vue

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

Loading…
Cancel
Save