Fixing handling of invalid feed url on share story feed finding.

This commit is contained in:
Samuel Clay 2018-07-13 11:23:56 -04:00
parent 355222549f
commit cc615e6d04

View file

@ -490,7 +490,7 @@ class Feed(models.Model):
if not feed and fetch and create:
try:
r = requests.get(url)
except requests.ConnectionError:
except (requests.ConnectionError, requests.models.InvalidURL):
r = None
if r and 'application/json' in r.headers.get('Content-Type'):
feed = cls.objects.create(feed_address=url)