From 0f6ac2e49addb571b62d3a1027f5c8ef6c931fa7 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 9 Mar 2017 08:26:29 +0100 Subject: Export: full path for urls --- ishtar_common/views.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ishtar_common') diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 6a03f1f60..18bdc6e36 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -996,12 +996,20 @@ def get_item(model, func_name, default_name, extra_request_keys=[], v = getattr(v, ky) if callable(v): v = v() + if hasattr(v, 'url'): + v = request.is_secure() and \ + 'https' or 'http' + '://' + \ + request.get_host() + v.url new_vals.append(v) elif val: try: val = getattr(val, ky) if callable(val): val = val() + if hasattr(val, 'url'): + val = request.is_secure() and \ + 'https' or 'http' + '://' + \ + request.get_host() + val.url new_vals.append(val) except AttributeError: # must be a query key such as "contains" -- cgit v1.2.3