From a6d95991f82f6a9a110a3c5e323c7f8d4ab4b3f3 Mon Sep 17 00:00:00 2001 From: "luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f" Date: Fri, 23 Apr 2010 01:54:13 +0000 Subject: fixed 404 template and photo importing script --- apps/photos/utils.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'apps') 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/' -- cgit v1.2.3-70-g09d2