mirror of
https://github.com/Hopiu/wagtail-modeltranslation.git
synced 2026-05-15 18:53:21 +00:00
Merge pull request #80 from dpratter/master
Copy content of streamfield fails with 414 Request-URI Too Long
This commit is contained in:
commit
79ca8fdf00
2 changed files with 7 additions and 5 deletions
|
|
@ -49,7 +49,7 @@ function requestCopyField(originID, targetID) {
|
|||
*/
|
||||
$.ajax({
|
||||
url: 'copy_translation_content',
|
||||
type: 'GET',
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {'origin_field_name': originID, 'target_field_name': targetID, 'serializedOriginField': jsonString},
|
||||
})
|
||||
|
|
@ -59,7 +59,7 @@ function requestCopyField(originID, targetID) {
|
|||
$(wrapperDiv).html(data);
|
||||
})
|
||||
.fail(function(error) {
|
||||
console.log("wagtail-modeltranslation error: %s", error);
|
||||
console.log("wagtail-modeltranslation error: %s", error.responseText);
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ from django.conf import settings
|
|||
from django.conf.urls import url
|
||||
from django.http import QueryDict
|
||||
from django.http import HttpResponse
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
|
||||
from wagtail.wagtailcore import hooks
|
||||
from wagtail.wagtailcore.models import Page
|
||||
|
|
@ -34,6 +35,7 @@ def translated_slugs():
|
|||
###############################################################################
|
||||
# Copy StreamFields content
|
||||
###############################################################################
|
||||
@csrf_exempt
|
||||
def return_translation_target_field_rendered_html(request, page_id):
|
||||
"""
|
||||
Ajax view that allows to duplicate content
|
||||
|
|
@ -43,10 +45,10 @@ def return_translation_target_field_rendered_html(request, page_id):
|
|||
page = Page.objects.get(pk=page_id)
|
||||
|
||||
if request.is_ajax():
|
||||
origin_field_name = request.GET.get('origin_field_name')
|
||||
target_field_name = request.GET.get('target_field_name')
|
||||
origin_field_name = request.POST.get('origin_field_name')
|
||||
target_field_name = request.POST.get('target_field_name')
|
||||
origin_field_serialized = json.loads(
|
||||
request.GET.get('serializedOriginField'))
|
||||
request.POST.get('serializedOriginField'))
|
||||
|
||||
# Patch field prefixes from origin field to target field
|
||||
target_field_patched = []
|
||||
|
|
|
|||
Loading…
Reference in a new issue