From: Jan Szejko Date: Thu, 27 Apr 2017 11:22:26 +0000 (+0200) Subject: fix for null source urls X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/a9d6b8ff42fe6dae988f8157d1b814e2169ce941?hp=29d7fc838e192b6a18dd31d81fe9ab1bc37b6cbb fix for null source urls --- diff --git a/apps/cover/management/commands/refresh_covers.py b/apps/cover/management/commands/refresh_covers.py index 854f3bbe..81ff9b87 100644 --- a/apps/cover/management/commands/refresh_covers.py +++ b/apps/cover/management/commands/refresh_covers.py @@ -22,7 +22,7 @@ class Command(BaseCommand): from_id = options.get('from_id', 1) for image in Image.objects.filter(id__gte=from_id).exclude(book=None).order_by('id'): print image.id - if 'flickr.com' in image.source_url: + if image.source_url and 'flickr.com' in image.source_url: try: flickr_data = get_flickr_data(image.source_url) except FlickrError as e: