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
commit81ee5b2f6d5bb4868128296108a0e99074d1ca72 (patch)
treef0483dd76ac5fdc986935be6644767ad4a3782d3 /ishtar_common/views_item.py
parente7cd4616d041ff147ad80534bdc6daa6d724504b (diff)
downloadIshtar-81ee5b2f6d5bb4868128296108a0e99074d1ca72.tar.bz2
Ishtar-81ee5b2f6d5bb4868128296108a0e99074d1ca72.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):