From a9d6b8ff42fe6dae988f8157d1b814e2169ce941 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Thu, 27 Apr 2017 13:22:26 +0200 Subject: [PATCH 1/1] fix for null source urls --- apps/cover/management/commands/refresh_covers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: -- 2.20.1