From e04f3d0ac3f7a67dcdcb2ba497e2e62b8e897095 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Fri, 7 Feb 2020 16:00:48 +0100 Subject: [PATCH] Some fixes --- app/services/views.py | 6 +++--- app/static/js/nopaque.lists.js | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/services/views.py b/app/services/views.py index aa2cd485..ae2c637a 100644 --- a/app/services/views.py +++ b/app/services/views.py @@ -12,8 +12,8 @@ import os SERVICES = {'corpus_analysis': {'name': 'Corpus analysis'}, 'setup_files': {'name': 'Setup files', - 'resources': {'mem_mb': 4096, 'n_cores': 4}, - 'add_job_form': AddSetupFilesJobForm}, + 'resources': {'mem_mb': 4096, 'n_cores': 4}, + 'add_job_form': AddSetupFilesJobForm}, 'nlp': {'name': 'Natural Language Processing', 'resources': {'mem_mb': 4096, 'n_cores': 2}, 'add_job_form': AddNLPJobForm}, @@ -59,7 +59,7 @@ def service(service): job.delete() flash('Internal Server Error') return make_response( - {'redirect_url': url_for('services.service', service='ocr')}, + {'redirect_url': url_for('services.service', service=service)}, 500) else: for file in add_job_form.files.data: diff --git a/app/static/js/nopaque.lists.js b/app/static/js/nopaque.lists.js index 5daaa43e..ba61b8d4 100644 --- a/app/static/js/nopaque.lists.js +++ b/app/static/js/nopaque.lists.js @@ -7,7 +7,7 @@ class RessourceList extends List { _init(ressources) { - this.add(Object.values(ressources)); + this.addRessources(Object.values(ressources)); this.sort("creation_date", {order: "desc"}); } @@ -21,7 +21,7 @@ class RessourceList extends List { switch(operation.op) { case "add": if (pathArray.includes("results")) {break;} - this.add([operation.value]); + this.addRessources([operation.value]); break; case "remove": this.remove("id", pathArray[0]); @@ -42,11 +42,11 @@ class RessourceList extends List { } - add(ressources) { + addRessources(ressources) { if (this.dataMapper) { - super.add(ressources.map(x => this.dataMapper(x))); + this.add(ressources.map(x => this.dataMapper(x))); } else { - super.add(ressources); + this.add(ressources); } } }