diff options
Diffstat (limited to 'apps/photos/utils.py')
-rw-r--r-- | apps/photos/utils.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/apps/photos/utils.py b/apps/photos/utils.py index 0e69c4e..b3d8be1 100644 --- a/apps/photos/utils.py +++ b/apps/photos/utils.py @@ -252,18 +252,22 @@ def sync_sets(*args, **kwargs): # okay it already exists, but is it up-to-date? #get_photos_in_set(row,set.id) - except ObjectDoesNotExist: - s = PhotoGallery.objects.create ( - set_id = force_unicode(info['id']), - set_title = force_unicode(post.findtext('title')), - set_desc = force_unicode(post.findtext('description')), - set_slug = slugify(force_unicode(post.findtext('title'))), - primary = force_unicode(info['primary']), - ) - get_photos_in_set(s) - #create the gallery thumbnail image: - photo = Photo.objects.get(flickr_id__exact=str(info['primary'])) - make_gallery_thumb(photo,s) + except ObjectDoesNotExist: + disregard = ['POTD 2008','Snow Day','Wedding','Some random stuff'] + if force_unicode(post.findtext('title')) in disregard: + pass + else: + s = PhotoGallery.objects.create ( + set_id = force_unicode(info['id']), + set_title = force_unicode(post.findtext('title')), + set_desc = force_unicode(post.findtext('description')), + set_slug = slugify(force_unicode(post.findtext('title'))), + primary = force_unicode(info['primary']), + ) + get_photos_in_set(s) + #create the gallery thumbnail image: + photo = Photo.objects.get(flickr_id__exact=str(info['primary'])) + make_gallery_thumb(photo,s) def get_photos_in_set(set): BASE_PATH = 'http://flickr.com/services/rest/' |