summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-07-05 23:36:34 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-07-05 23:36:34 +0200
commiteae9d2216600e52eaf1edb65f082ef33a2ba8cec (patch)
tree1b01ac16d72ab8d43d1d7554aee5f1306f987ec7 /ishtar_common
parentd58c3ee3b823cb056967608bfbf81127249fc120 (diff)
downloadIshtar-eae9d2216600e52eaf1edb65f082ef33a2ba8cec.tar.bz2
Ishtar-eae9d2216600e52eaf1edb65f082ef33a2ba8cec.zip
Template tags: fix field url with empty url
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/templates/ishtar/sheet_source.html4
-rw-r--r--ishtar_common/templatetags/window_field.py6
2 files changed, 4 insertions, 6 deletions
diff --git a/ishtar_common/templates/ishtar/sheet_source.html b/ishtar_common/templates/ishtar/sheet_source.html
index 244ca1be3..24477ce2c 100644
--- a/ishtar_common/templates/ishtar/sheet_source.html
+++ b/ishtar_common/templates/ishtar/sheet_source.html
@@ -19,8 +19,8 @@
{% field_li "Source type" item.source_type %}
{% field_li "Format type" item.format_type %}
{% field_li "Scale" item.scale %}
- {% trans "Web link" as weblink_label %}
- {% field_li_url weblink_label item.associated_url %}
+{% trans "Web link" as weblink_label %}
+{% field_li_url weblink_label item.associated_url %}
{% field_li "Item number" item.item_number %}
{% field_li "Ref." item.reference %}
{% field_li "Internal ref." item.internal_reference %}
diff --git a/ishtar_common/templatetags/window_field.py b/ishtar_common/templatetags/window_field.py
index 5180955d8..022986493 100644
--- a/ishtar_common/templatetags/window_field.py
+++ b/ishtar_common/templatetags/window_field.py
@@ -25,10 +25,8 @@ def field_li(caption, data, pre_data='', post_data=''):
def field_url(caption, link, link_name='', li=False):
if link:
link = link.strip()
- if not link:
- return u''
- if not link.startswith('http://') and not link.startswith('https://'):
- link = 'http://' + link
+ if not link.startswith('http://') and not link.startswith('https://'):
+ link = 'http://' + link
return {'caption': caption, 'link': link, "link_name": link_name, 'li': li}