Kaydet (Commit) 4f8cbf08 authored tarafından Piotr Jakimiak's avatar Piotr Jakimiak Kaydeden (comit) Tim Graham

Replaced multiple startswith in syndication/views.py

üst 34b6b89b
...@@ -19,9 +19,7 @@ def add_domain(domain, url, secure=False): ...@@ -19,9 +19,7 @@ def add_domain(domain, url, secure=False):
if url.startswith('//'): if url.startswith('//'):
# Support network-path reference (see #16753) - RSS requires a protocol # Support network-path reference (see #16753) - RSS requires a protocol
url = '%s:%s' % (protocol, url) url = '%s:%s' % (protocol, url)
elif not (url.startswith('http://') elif not url.startswith(('http://', 'https://', 'mailto:')):
or url.startswith('https://')
or url.startswith('mailto:')):
url = iri_to_uri('%s://%s%s' % (protocol, domain, url)) url = iri_to_uri('%s://%s%s' % (protocol, domain, url))
return url return url
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment