summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-10-04 23:56:27 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-10-24 12:06:09 +0200
commitd13b19fb346b50b60f546c955f8ea8e9f552b726 (patch)
tree9ce5ad9295b69bbb6657230ab7d1d72acde6d4a0
parente4c7fcdf67edb1ea0a74a91d359b8300ede3590b (diff)
downloadIshtar-d13b19fb346b50b60f546c955f8ea8e9f552b726.tar.bz2
Ishtar-d13b19fb346b50b60f546c955f8ea8e9f552b726.zip
JS: Fix find edition
-rw-r--r--archaeological_finds/forms.py2
-rw-r--r--ishtar_common/templates/blocks/DataTables.html6
2 files changed, 5 insertions, 3 deletions
diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py
index af3c5356f..b77560ac9 100644
--- a/archaeological_finds/forms.py
+++ b/archaeological_finds/forms.py
@@ -721,7 +721,7 @@ class FindFormSelection(CustomFormSearch):
label="", required=False,
widget=widgets.DataTable(
reverse_lazy('get-find'),
- FindSelect, models.Find,
+ FindSelect, models.Find,
source_full=reverse_lazy('get-find-full')),
validators=[valid_id(models.Find)])
diff --git a/ishtar_common/templates/blocks/DataTables.html b/ishtar_common/templates/blocks/DataTables.html
index 8af5f1a7b..b5f669963 100644
--- a/ishtar_common/templates/blocks/DataTables.html
+++ b/ishtar_common/templates/blocks/DataTables.html
@@ -241,8 +241,10 @@ jQuery(document).ready(function(){
{% if multiple_select %}
var value = "";
for (k in data){
- if (k > 0) value += ",";
- value += data[k]['id'];
+ if (typeof data[k]['id'] != "undefined") {
+ if (value) value += ",";
+ value += data[k]['id'];
+ }
}
{% else %}
var value = data[0]['id'];