Browse Source

[export] When exporting query result to excel it create's wrong HYPERLINK's for results with http GH-1889 (asnaik) (#1890)

Co-authored-by: Akhil Naik <asnaik@cloudere.com>
Akhil S Naik 4 years ago
parent
commit
2fbbfc665d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      desktop/core/src/desktop/lib/export_csvxls.py

+ 1 - 1
desktop/core/src/desktop/lib/export_csvxls.py

@@ -72,7 +72,7 @@ def encode_row(row, encoding=None, make_excel_links=False):
     if isinstance(cell, six.string_types):
       cell = re.sub(ILLEGAL_CHARS, '?', cell)
       if make_excel_links:
-        cell = re.compile('(https?://.+)', re.IGNORECASE).sub(r'=HYPERLINK("\1")', cell)
+        cell = re.compile('^(https?://.+)', re.IGNORECASE).sub(r'=HYPERLINK("\1")', cell)
     cell = nullify(cell)
     if not isinstance(cell, numbers.Number):
       cell = smart_str(cell, encoding, strings_only=True, errors='replace')