From 0339f2b244b788da6d694f801a45ee7efca55cd1 Mon Sep 17 00:00:00 2001
From: Samuel Gaist <samuel.gaist@idiap.ch>
Date: Thu, 7 May 2020 13:56:53 +0200
Subject: [PATCH] [algorithms][templates][edition] Fix data handling in data
 generation

---
 .../algorithms/templates/algorithms/edition.html  | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/beat/web/algorithms/templates/algorithms/edition.html b/beat/web/algorithms/templates/algorithms/edition.html
index 940b638ac..0c9cd5ed0 100644
--- a/beat/web/algorithms/templates/algorithms/edition.html
+++ b/beat/web/algorithms/templates/algorithms/edition.html
@@ -329,13 +329,14 @@ function setupEditor(algorithm, dataformats, libraries)
 
     var data = {
       {% if not edition %}
-      {% if algorithm_version > 1 and not fork_of %}
-      name: '{{ algorithm_name }}',
-      version: '{{ algorithm_version }}',
-      previous_version:'{{ algorithm_author }}/{{ algorithm_name }}/{{ algorithm_version|add:-1 }}',
-      {% else %}
-      name: $('#algorithm_name')[0].value.trim(),
-      {% endif %}
+        {% if algorithm_version > 1 and not fork_of %}
+            name: '{{ algorithm_name }}',
+            version: {{ algorithm_version }},
+            previous_version:'{{ algorithm_author }}/{{ algorithm_name }}/{{ algorithm_version|add:-1 }}',
+        {% else %}
+          name: $('#algorithm_name')[0].value.trim(),
+          version: 1,
+        {% endif %}
       description: (algorithm && algorithm.description) || '',
       {% endif %}
       short_description: (algorithm && algorithm.short_description) || '',
-- 
GitLab