[merge] manually update from develop

This commit is contained in:
Rushabh Mehta 2014-09-29 12:46:58 +05:30
parent 5bbefc0728
commit a3ee77fd98
2 changed files with 10 additions and 7 deletions

View file

@ -122,13 +122,16 @@ def get_linked_docs(doctype, name, metadata_loaded=None, no_metadata=False):
fields = ["`tab{dt}`.`{fn}`".format(dt=dt, fn=sf.strip()) for sf in fields if sf]
if link.get("child_doctype"):
ret = frappe.get_list(doctype=dt, fields=fields,
filters=[[link.get('child_doctype'), link.get("fieldname"), '=', name]])
try:
if link.get("child_doctype"):
ret = frappe.get_list(doctype=dt, fields=fields,
filters=[[link.get('child_doctype'), link.get("fieldname"), '=', name]])
else:
ret = frappe.get_list(doctype=dt, fields=fields,
filters=[[dt, link.get("fieldname"), '=', name]])
else:
ret = frappe.get_list(doctype=dt, fields=fields,
filters=[[dt, link.get("fieldname"), '=', name]])
except frappe.PermissionError:
continue
if ret:
results[dt] = ret

View file

@ -583,7 +583,7 @@ def expand_relative_urls(html):
def quote_urls(html):
def _quote_url(match):
groups = list(match.groups())
groups[2] = urllib.quote(groups[2], safe="~@#$&()*!+=:;,.?/'")
groups[2] = urllib.quote(groups[2].encode("utf-8"), safe=b"~@#$&()*!+=:;,.?/'").decode("utf-8")
return "".join(groups)
return re.sub('(href|src){1}([\s]*=[\s]*[\'"]?)((?:http)[^\'">]+)([\'"]?)',
_quote_url, html)