diff options
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 |
commit | 773779d80c2161fc426302672e80fd92970ec2f0 (patch) | |
tree | 651d72e082d4975b57daf2f391b1d9b82d2925e8 | |
parent | 94cb9ad1fda2e50136f9d9e2ae8f5db7f7f81b05 (diff) | |
download | Ishtar-773779d80c2161fc426302672e80fd92970ec2f0.tar.bz2 Ishtar-773779d80c2161fc426302672e80fd92970ec2f0.zip |
Fix document edition
-rw-r--r-- | archaeological_operations/models.py | 3 | ||||
-rw-r--r-- | ishtar_common/views.py | 2 |
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 |