From 4f8cbf08beee01bd214a56309db81ef258b8e2fc Mon Sep 17 00:00:00 2001 From: Piotr Jakimiak Date: Fri, 8 May 2015 09:32:21 +0200 Subject: [PATCH] Replaced multiple startswith in syndication/views.py --- django/contrib/syndication/views.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/django/contrib/syndication/views.py b/django/contrib/syndication/views.py index e8511ddfc9..3d310ba1f4 100644 --- a/django/contrib/syndication/views.py +++ b/django/contrib/syndication/views.py @@ -19,9 +19,7 @@ def add_domain(domain, url, secure=False): if url.startswith('//'): # Support network-path reference (see #16753) - RSS requires a protocol url = '%s:%s' % (protocol, url) - elif not (url.startswith('http://') - or url.startswith('https://') - or url.startswith('mailto:')): + elif not url.startswith(('http://', 'https://', 'mailto:')): url = iri_to_uri('%s://%s%s' % (protocol, domain, url)) return url