summaryrefslogtreecommitdiff
path: root/ishtar_common/views_item.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-05-31 13:27:29 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-06-17 13:21:28 +0200
commitfc66ccfca7c84fa7242837c8487a4b742b50bd78 (patch)
treef0483dd76ac5fdc986935be6644767ad4a3782d3 /ishtar_common/views_item.py
parentc66c834d7e32245a2cb97857dd604a6482f7fe0e (diff)
downloadIshtar-fc66ccfca7c84fa7242837c8487a4b742b50bd78.tar.bz2
Ishtar-fc66ccfca7c84fa7242837c8487a4b742b50bd78.zip
Fix gallery image for documents
Diffstat (limited to 'ishtar_common/views_item.py')
-rw-r--r--ishtar_common/views_item.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py
index f14b146fa..53c65c3aa 100644
--- a/ishtar_common/views_item.py
+++ b/ishtar_common/views_item.py
@@ -1860,8 +1860,11 @@ def get_item(model, func_name, default_name, extra_request_keys=None,
tab_cols.append(tc)
k = "__".join(tab_cols)
if k.endswith("__image") or k.endswith("__thumbnail"):
- if not value.startswith(settings.MEDIA_ROOT):
+ if not value.startswith(settings.MEDIA_ROOT) and not \
+ value.startswith("http://") and not \
+ value.startswith("https://"):
value = settings.MEDIA_URL + value
+
if hasattr(model, 'COL_LINK') and k in model.COL_LINK:
value = link_ext_template.format(value, value)
if isinstance(value, datetime.date):