[Erp5-report] r36447 lucas - /erp5/trunk/products/ERP5/Document/Url.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Jun 18 15:08:43 CEST 2010
Author: lucas
Date: Fri Jun 18 15:08:41 2010
New Revision: 36447
URL: http://svn.erp5.org?rev=36447&view=rev
Log:
Now if you have the url defined as localhost:9181/test_client it will return the correct url including the protocol.
Modified:
erp5/trunk/products/ERP5/Document/Url.py
Modified: erp5/trunk/products/ERP5/Document/Url.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Url.py?rev=36447&r1=36446&r2=36447&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Url.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Url.py [utf8] Fri Jun 18 15:08:41 2010
@@ -55,8 +55,6 @@ class UrlMixIn:
url_string = self.getUrlString()
if not url_string:
return None
- if urllib.splittype(url_string)[0]:
- return url_string
protocol = self.getUrlProtocol()
if not protocol:
# A quick fix for all objects which did not
@@ -66,8 +64,13 @@ class UrlMixIn:
protocol = default_protocol_dict[ptype]
else:
protocol = 'http'
+
if protocol in no_host_protocol_list or url_string.startswith('//'):
return '%s:%s' % (protocol, url_string)
+
+ if url_string.startswith(protocol):
+ return url_string
+
return '%s://%s' % (protocol, url_string)
security.declareProtected(Permissions.ModifyPortalContent, 'fromText')
More information about the Erp5-report
mailing list