diff options
author | luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f <luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f> | 2010-04-23 01:54:13 +0000 |
---|---|---|
committer | luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f <luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f> | 2010-04-23 01:54:13 +0000 |
commit | a6d95991f82f6a9a110a3c5e323c7f8d4ab4b3f3 (patch) | |
tree | e4f91b0a16d9a0aae1027a973915d8f87d5c55e9 /apps/photos/utils.py | |
parent | eaa95c860b89693e5ffd9b6df1d1375b2c03a14b (diff) |
fixed 404 template and photo importing script
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/' |