diff --git a/frontend/src/components/unification/shared/LexicalUnitDisplay.vue b/frontend/src/components/unification/shared/LexicalUnitDisplay.vue index 518dbdc96ccca786ff986d2dfc9da2f224ab2271..ebac745e258132691cb61971edce84ea3969eb03 100644 --- a/frontend/src/components/unification/shared/LexicalUnitDisplay.vue +++ b/frontend/src/components/unification/shared/LexicalUnitDisplay.vue @@ -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/`, diff --git a/shellvalier/settings.py b/shellvalier/settings.py index 2f4ba078f2f1e64253a5c2513c8b59d02125284f..45be427ce3e3ded1e9a9240db05cc715f888dd1f 100644 --- a/shellvalier/settings.py +++ b/shellvalier/settings.py @@ -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=") diff --git a/unifier/views.py b/unifier/views.py index 00212f3e339733256a231b3ebe3bb12f943b41e8..b91e59d8b0eb2e865413bce8800a2889835d1d11 100644 --- a/unifier/views.py +++ b/unifier/views.py @@ -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,