Skip to content
Snippets Groups Projects
Commit 00f155c4 authored by dcz's avatar dcz
Browse files

Unified frame creation external service

parent 000a7941
No related branches found
No related tags found
No related merge requests found
......@@ -54,7 +54,8 @@ export default {
if (this.hasWhiteSpace(title) || title.length === 0) {
alert(gettext("Nazwa zunifikowanej ramy nie może być pusta oraz nie może zawierać białych znaków."));
} else {
const data = {'lu_id': this.lexicalUnitId, 'unified_frame_title': title};
const data = {'lu_id': this.lexicalUnitId, 'unified_frame_title': title,
'frame_id': this.frame.id};
$.ajax({
type : 'post',
url : `/${lang}/unifier/frame_assign/`,
......
......@@ -188,3 +188,6 @@ EMAIL_USE_SSL = get_environment('EMAIL_USE_SSL', mapper=boolean_mapper)
SUPER_LEXICOGRAPHS_GROUP_NAME = 'Super Leksykografowie'
DATE_INPUT_FORMATS = ['%d-%m-%Y']
UNIFIED_FRAME_SERVICE_URL = get_environment('UNIFIED_FRAME_SERVICE_URL',
default="http://127.0.0.1:8000/en/unifier/build_unified_frame_xml/?lu_id=")
......@@ -26,6 +26,7 @@ import io
from xml.sax import handler, make_parser
from django.db.models import Q
from django.conf import settings
@ajax_required
@transaction.atomic
......@@ -515,8 +516,8 @@ def change_unified_frame_status_to_verified_by_superleksykograf(request):
return JsonResponse({})
def create_unified_frame(lu_id):
response = requests.post('http://127.0.0.1:8000/en/unifier/build_unified_frame_xml/?lu_id=' + str(lu_id))
def create_unified_frame(frame_id):
response = requests.post(settings.UNIFIED_FRAME_SERVICE_URL + str(frame_id), timeout=(1000, 1000))
parser = make_parser()
parser.setFeature(handler.feature_external_ges, False)
......@@ -592,9 +593,10 @@ def frame_assign(request):
if request.method == 'POST':
lu_id = request.POST['lu_id']
frame_id = request.POST['frame_id']
unified_frame_title = request.POST['unified_frame_title']
unified_frame_pk = create_unified_frame(lu_id)
unified_frame_pk = create_unified_frame(frame_id)
unifiedFrame = get_object_or_404(
UnifiedFrame.objects,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment