From 83b4671112914081b3912dc06f006ed84147386a Mon Sep 17 00:00:00 2001 From: François Schmidts Date: Tue, 4 Aug 2015 10:33:15 +0200 Subject: more elegant method to check for icons --- pyaggr3g470r/controllers/feed.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'pyaggr3g470r/controllers/feed.py') diff --git a/pyaggr3g470r/controllers/feed.py b/pyaggr3g470r/controllers/feed.py index 6b3c4fb5..a8e96217 100644 --- a/pyaggr3g470r/controllers/feed.py +++ b/pyaggr3g470r/controllers/feed.py @@ -21,7 +21,6 @@ import logging from datetime import datetime, timedelta -from werkzeug.exceptions import NotFound import conf from .abstract import AbstractController @@ -59,9 +58,7 @@ class FeedController(AbstractController): if not attrs.get('icon_url'): return icon_contr = IconController() - try: - icon_contr.get(url=attrs['icon_url']) - except NotFound: + if not icon_contr.read(url=attrs['icon_url']).count(): icon_contr.create(**{'url': attrs['icon_url']}) def create(self, **attrs): -- cgit