summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-06-13 12:05:10 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-06-13 12:05:10 +0200
commitadf8899ecf6aaa9d210dca13b6cc1366eedd206a (patch)
tree651d72e082d4975b57daf2f391b1d9b82d2925e8
parent2eb5911063da64654d9f5890eaeb4d6172823e47 (diff)
downloadIshtar-adf8899ecf6aaa9d210dca13b6cc1366eedd206a.tar.bz2
Ishtar-adf8899ecf6aaa9d210dca13b6cc1366eedd206a.zip
Fix document edition
-rw-r--r--archaeological_operations/models.py3
-rw-r--r--ishtar_common/views.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index b180d333e..fd2559626 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -93,8 +93,7 @@ class ArchaeologicalSite(BaseHistorizedItem):
SLUG = 'site'
BASE_SEARCH_VECTORS = [
"reference", "name", "oceanographic_service_localisation",
- "shipwreck_code", "comment", "shipwreck_name", "discovery_area"
-
+ "shipwreck_code", "comment", "shipwreck_name", "discovery_area",
]
M2M_SEARCH_VECTORS = ["periods__name", "remains__name", "towns__name"]
PARENT_SEARCH_VECTORS = ['operations']
diff --git a/ishtar_common/views.py b/ishtar_common/views.py
index 22452ca91..5a35c2509 100644
--- a/ishtar_common/views.py
+++ b/ishtar_common/views.py
@@ -1642,6 +1642,8 @@ class DocumentEditView(DocumentFormMixin, UpdateView):
value = getattr(document, k)
if hasattr(value, 'all'):
value = ",".join([str(v.pk) for v in value.all()])
+ if hasattr(value, 'pk'):
+ value = value.pk
initial[k] = value
kwargs['initial'] = initial